开发者

jquery, how to enable this checkbox that has unique type, name and value

I开发者_StackOverflow中文版 created this somewhere in perl:

print qq|<td><input type="checkbox" name="dbtableselect" value="$row[0]"/></td>|;

I tried this syntax but it isn't working. what is the correct syntax format?

 var keyid = \$(this).attr('name').match(/\d+/g);

 \$('input[type=checkbox,name=dbtableselect,value=' + keyid + ').attr('checked', true);


Those are Attribute Equals Selectors. Each attribute comparison goes into it's own pair of square brackets, like this:

$('input[type=checkbox][name=dbtableselect][value=' + keyid + ']').attr('checked', true);


Try: $('input[type=checkbox][name=dbtableselect][value=' + keyid + ']').

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜