开发者

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

开发者 https://www.devze.com 2023-01-29 11:59 出处:网络
I开发者_StackOverflow中文版 created this somewhere in perl: print qq|<td><input type=\"checkbox\" name=\"dbtableselect\" value=\"$row[0]\"/></td>|;

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

精彩评论

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