我想要用JS实现: 点击表格 再点一个按钮 点击的那一行可以编辑(其他不行) 弄了很久弄不出啊  请各位大侠帮帮小弟。。很急啊

解决方案 »

  1.   

    手写了个demo,复制保存到txt,然后改成test.html,运行试试。
    <head>
    <script type="text/javascript">
    function edit(param){
    var tempid = param.id.substring(2,5);
    document.getElementById(tempid).removeAttribute("disabled");
    }
    </script>
    </head>
    <body>
    <table>
    <tr><td><input id="td1" type="text" value="1" disabled="true"></td><td><input id="b1td1" type="button" value="b1" onclick="edit(this);"></td></tr>
    <tr><td><input id="td2" type="text" value="2" disabled="true"></td><td><input id="b2td2" type="button" value="b2" onclick="edit(this);"></td></tr>
    <tr><td><input id="td3" type="text" value="3" disabled="true"></td><td><input id="b3td3" type="button" value="b3" onclick="edit(this);"></td></tr>
    <tr><td><input id="td4" type="text" value="4" disabled="true"></td><td><input id="b4td4" type="button" value="b4" onclick="edit(this);"></td></tr>
    </table>
    </body>