This article mainly introduces JavaScript to get the page title code example, you need friends can refer to the
The code is as follows: <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title>javascript_ get page title code </title> <script language=" JavaScript "> function Get_pagetitle (split_chr,new_pagetit) { var titleitems,return_title; var the_pagetitle=document.title; titleitems=the_pagetitle.split (SPLIT_CHR); return_title=the_pagetitle; if (Titleitems[1]) { return_title=the_pagetitle.replace (titleitems[1],new_pagetit) } else { if (new_pagetit) { return_title=the_pagetitle & split_chr & new_pagetit; &n Bsp &NBSP} alert (Return_title); } </script> </head> <body> <input value= "Test type=" button "onclick=" javascript:get_ PageTitle (' _ ', ' = '); "/> </body> </html>