<table id="table1">
</table>js:document.all.table1.iddocument.all.table1.name

解决方案 »

  1.   

    <xsl:element name="table">
    <xsl:attribute name="width">98%</xsl:attribute>
    <xsl:attribute name="align">center</xsl:attribute>
    <xsl:attribute name="cellspacing">0</xsl:attribute>
    <xsl:attribute name="ID">DB_TABLE_<xsl:value-of select="@ID"/></xsl:attribute>
    <xsl:attribute name="bgcolor">#FFFFFF</xsl:attribute>
    <tr>
    <td height="1"></td>
    </tr>
    ..........
    然后调用函数 DBCheck(this,DB_TABLE_<xsl:value-of select="@ID"/>);
    (function DBCheck(oCheck,oTable))
    在DBCheck里想 var  tableID = document.all.oTable.ID; 
    却无法取到ID的值
    怎么回事?
      

  2.   

    tagtable = document.getElementById("tableid")
      

  3.   

    我是想通过table得到他的id值而不是通过id得到table对象啊
    alert(oTable.id)为什么是undefined;
      

  4.   

    以上说的都对,建议你看看关于js的dom方面的知识 这样你能有一个比较全面的了解
    可以看看msdn
      

  5.   

    JavaScript<table id=bao><tr><td>wanghr100</td></tr></table>
    <script language="JavaScript">
    var o = document.getElementsByTagName("table")[0]
    alert(o.id)
    </script>