<%i=0%>
<table id=a<%=i%>></table>
<%i=i+1%>
.....

解决方案 »

  1.   

    我在源码中这样写的
    <script>
    var k="sdsd";
    </script>
    ....
    <table id="k";>
    </table>
    但在使用sdsd的属性是老是说我对象没定义.应该怎么做?
    哪里出问题了?这样的写法有问题么?
    正确的应该怎么写?谢谢了^_^  你那个<% %>是什么标记来的?我是菜鸟别笑我.^_^
      

  2.   

    <table id=pp>
    </table>
    <script>
    var strid='k';
    window['o']=document.all('pp');
    window['o'].id=k;
    </script>
      

  3.   

    <input id=bt type=button onclick='alert("原来的ID是"+this.id);this.id="hi";alert("现在的ID是"+this.id)' value='变'> 
      

  4.   

    用asp写也可以的.
    <%
      dim a
      a=1
    %>
    <table id="<% response.write cstr(a)
      a=a+1
    %>">
    <table id="<% response.write cstr(a)
      a=a+1
    %>">