IDが#alertTableのセルをクリックして内容を書き換える
1 2 3 4 5 6 7 8 9 10 11 12 |
<!-- script --> <script> $(function(){ $('[id=alertTable] > tbody > tr > td').on('click',function(){ y = this.parentNode.rowIndex; x = this.cellIndex; selector = "table tr:eq(" + y + ") td:eq(" + x + ")" $(selector).text("change"); }); }); </script> <!-- script --> |