g = $(".th-bg:first").siblings();
for (var i = 0; i< g.length; i ++)
{$('g[i]').children("td:first").append('<input type="button" value="BTTS">')};
我想给 th-bg 所有兄弟标签的第一个子标签增加一个按钮事件。 这里哪里写错了呀?
下面这样是可以的,但是只能增加第一个,为什么?? 求解
$(".th-bg:first").siblings().children("td:first").append('<input type="button" value="BTTS">');
for (var i = 0; i< g.length; i ++)
{$('g[i]').children("td:first").append('<input type="button" value="BTTS">')};
我想给 th-bg 所有兄弟标签的第一个子标签增加一个按钮事件。 这里哪里写错了呀?
下面这样是可以的,但是只能增加第一个,为什么?? 求解
$(".th-bg:first").siblings().children("td:first").append('<input type="button" value="BTTS">');