首页 > Web开发 > 详细

js修改title

时间:2014-02-11 15:43:05      阅读:430      评论:0      收藏:0      [点我收藏+]

  使用javascript修改title

  1.这个在chrome中可以成功,在ie8中报错

   

bubuko.com,布布扣
<!DOCTYPE html>
<html>
    <head>
        <title id="title">我是标题</title>
        <script type="text/javascript">
                var title = document.getElementById(‘title‘);
                title.innerText = "我是修改后的标题"; 
        </script>
    </head>    
    <body>
            
    </body>
</html>
bubuko.com,布布扣

 

  2.ie8中修改方法:

 

bubuko.com,布布扣
<!DOCTYPE html>
<html>
    <head>
        <title id="title">我是标题</title>
        <script type="text/javascript">
                document.title = "我是修改后的标题"; 
        </script>
    </head>    
    <body>
    </body>
</html>
bubuko.com,布布扣

 

  

js修改title

原文:http://www.cnblogs.com/jerry19890622/p/3543930.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!