3

使用选择器时

$(this).children('td ').eq(0).html() 

我明白了

<input name="abc" type="checkbox" value="checked" class="check2" id="xyz" checked="">

我想从此输入元素中获取“id”。

4

2 回答 2

2
$(this).children('td:first').find('input[type="checkbox"]').prop('id');
于 2013-02-08T09:59:32.657 回答
0

快点

var $t=$(this);

$t.find("> td:first-child").get(0).id

编辑以回答消失的评论:

当前获胜者

缓存的 .find()

var $a = $('#a'); $a.find('.b');

http://vaughnroyko.com/the-real-scoop-on-jquery-find-performance/

于 2013-02-08T10:07:20.730 回答