您现在的位置: 万盛学电脑网 >> 程序编程 >> 脚本专题 >> javascript >> 正文

JavaScript获取当前网页标题(title)的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 JS中的document.title可以获取当前网页的标题

  1 2 3 4 5 6 7 8 9 10 11 12 <!DOCTYPE html> <html> <head> <title>jb51.net</title> </head> <body> current document's title is: <script> document.write(document.title); </script> </body> </html>

运行结果如下:

1 current document's title is:jb51.net