<head>
<title>old title</title>
<style>
div
{
t:expression(this.ondblclick=function(){document.title='new title'})
}
</style>
</head><body>
<div id='d' style="background-color:red;width:200px;height:200px"></div>
</body>

解决方案 »

  1.   

    我想修改<style></style>里的内容应该怎么做呢?谢谢楼上几位
      

  2.   

    document.styleSheets[0].rules.item(1).style.backgroundColor = "red";
    //修改样式表文件里定义好的样式
      

  3.   

    //修改弹出窗口的标题
    <head>
    <title></title>
    <script>
    var win=window.open('2.htm');
    var i=window.setInterval("setTitle()",1000);
    function setTitle()
    {  //alert(win.window.readyState);
      if(win.document.readyState=='complete')
        {
          win.document.title='New title';
          window.clearInterval(i);
        }
    }
    </script>
    </head>