<SCRIPT>
function fnGetId(){
// Returns the first DIV element in the collection.
var oVDiv=document.getElementById("oDiv1");
}
</SCRIPT>
<DIV ID="oDiv1">Div #1</DIV>
<DIV ID="oDiv2">Div #2</DIV>
<DIV ID="oDiv3">Div #3</DIV>
<INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">

解决方案 »

  1.   

    alert("time_<%  Response.Write  ver%>");看看是什么.
      

  2.   

    <SCRIPT>
    function fnGetId(){
    // Returns the first DIV element in the collection.
    var oVDiv=document.getElementById("oDiv1");
    alert(oVDiv.innerHTML);
    }
    </SCRIPT>
    <DIV ID="oDiv1">Div #1</DIV>
    <DIV ID="oDiv2">Div #2</DIV>
    <DIV ID="oDiv3">Div #3</DIV>
    <INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">这样更直观点....
      

  3.   

    可以给我些document.getElementById的示例地址吗? 我看不大懂啊!
      

  4.   

    alert("time_<%  Response.Write  ver%>");
    里是一个判断 版本的东西 
    document.getElementById  函数 怎么用我可以去哪查到  谢谢你们了
      

  5.   

    引用document时你的html里边要有<body>标签,另外文档必须加载完成getElementById Method 
    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getelementbyid.asp
      

  6.   

    我的ie狀態欄總提示getElementById有點問體﹐但用得好好的。怎么不讓那提示顯示﹖