使用javascript修改title
1.这个在chrome中可以成功,在ie8中报错
<!DOCTYPE html> <html> <head> <title id="title">我是标题</title> <script type="text/javascript"> var title = document.getElementById('title'); title.innerText = "我是修改后的标题"; </script> </head> <body> </body> </html>
2.ie8中修改方法:
<!DOCTYPE html> <html> <head> <title id="title">我是标题</title> <script type="text/javascript"> document.title = "我是修改后的标题"; </script> </head> <body> </body> </html>