I want to change text in table td from 1,1,1 to 1,2,3 with jQuery
But it not seem to work. what is wrong in my code?
这是我的 Java本功能。
function reorder(targetId){
var i = 1;
jQuery.find(targetId).each(function(){
jQuery(this).attr("innerHTML", i);
i ++;
});
}
我的html代码。
<form>
<input type="button" onClick="reorder( #index );" value="test"/>
<table>
<tr><td id="index">1</td></tr>
<tr><td id="index">1</td></tr>
<tr><td id="index">1</td></tr>
</table>
</form>