这样?
<div class="vscrollerbar" id="mySwf">用js在此插入一个swf </div>
<script>
document.getElementById('myswf').innerHTML = '<embed src="http://image.it.com.cn/images/2008/focus.swf"  quality="high" width="380" height="280" allowScriptAccess="always" type="application/x-shockwave-flash"/>';
</script>

解决方案 »

  1.   

    就像楼上这样 使用innerHTML 
      

  2.   

    <div class="vscrollerbar"> 不能改变不可以加id
      

  3.   

    晕??那你怎么取得该div呢??难道只有该div才具有vscrollerbar这个class属性??
      

  4.   


    呵呵,你这个就比较难了,你的class又不是唯一的,你如何知道是给哪个DIV加?
      

  5.   

    css.scrollgeneric{line-height: 1px;font-size: 1px;position: absolute;top: 0;left: 0;}
    .vscrollerbase{width: 10px;background-color: white;}
    .vscrollerbar{width: 10px;background:url();}
    .hscrollerbase{height: 10px;background-color: white;}
    .hscrollerbar{height: 10px;background-color: black;}
    .scrollerjogbox{width: 10px;height: 10px;top: auto;left: auto;bottom: 0px;right: 0px;background-color: gray;}
    .copyrightnotice{font-size: 70%;font-weight: bold;text-align: center;font-family: Arial, Helvetica, sans-serif;text-indent: 0;}
    #mycustomscroll1 {width: 80%;height: 250px;overflow: auto;position: relative;background-color: #E7EADE;margin: 0.3em auto;padding: 15px;}
    .percentagewrap {width: 80%;margin: 0 auto;padding: 10px;}
    .fixedwidth {width: 550px;height: auto;position: relative;color: black;padding: 1px;}
    jshttp://artear.vicp.net/web/test/flexcroll.js
    html<div class="percentagewrap">
      <div id='mycustomscroll1' class='flexcroll'>
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />
    1<br />  </div>
    </div>
      

  6.   

    http://artear.vicp.net/web/test/flexcroll.js.txt
      

  7.   

    你不给改变div标签属性,就用document.getElementsByTagName("div")[i]吧,讲详细点i是你这个div在整个文档中所有div的索引,然后再用1楼的方法。如果div位置不定,就要遍历所有标签去判断className,如果className也有多个,干脆杀了我算了。
      

  8.   

    在css中这样写:
    .vscrollerbar{
    event:expression(
    document.getElementById('myswf').innerHTML = '<embed src="http://image.it.com.cn/images/2008/focus.swf"  quality="high" width="380" height="280" allowScriptAccess="always" type="application/x-shockwave-flash"/>';
    )
    }
      

  9.   

    .vscrollerbar{ 
    event:expression( 
    this.innerHTML = ' <embed src="http://image.it.com.cn/images/2008/focus.swf"  quality="high" width="380" height="280" allowScriptAccess="always" type="application/x-shockwave-flash"/>'; 

      

  10.   

    这样看符合你的要求吗?<!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>test</title>
    <style type="text/css">
    .vscrollerbar{ 
    event:expression(ShowFlash()) 

    </style>
    </head><body>
    <table width="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="vscrollerbar">123</embed>
        </object></td>
      </tr>
    </table>
    </body>
    </html>
    <script language="javascript">
    function ShowFlash()
    {
    var thtml="<EMBED align=left src=http://image.it.com.cn/images/2008/focus.swf height=300 width=400 type=application/x-shockwave-flash ; quality=high wmode=transparent menu=false></EMBED>";
    document.write(thtml);
    }
    </script>
      

  11.   

    13楼   你那个event:expression是OnlyIE的不知道这个<div class="vscrollerbar">其中DIV的Class属性是否唯一
    如果不唯一的话,也不知道vscrollerbar到底在页面中是第几个jQuery
    $("DIV.vscrollerbar").html("你要插入的内容")Js的你自己修改了测试下:
    var _vscroll = document.body.getElementsByTagName("DIV");
    for(i in _vscroll){
        var obj = _vscroll[i];
        if('className' == obj.class){//或者你可以多添加条件如根据是否有内容才判断
            obj.innerHTML = "你要插入的内容";
            break;
        }
    }