开发者

Is this JQuery valid?

开发者 https://www.devze.com 2022-12-13 12:33 出处:网络
Is this JQuery valid? $(\"[name=enableTooltip]:checked\") What does it does开发者_如何转开发?This is more understandable:

Is this JQuery valid? $("[name=enableTooltip]:checked")

What does it does开发者_如何转开发?


This is more understandable:

$("input[name=enableTooltip]:checked") 

This selects all inputs which has name attribute equals "enableTooltip" and checked status is true.

Example match:

<input type="checkbox" name="enableTooltip" checked="checked" />


The selector [attr=val] is a shortcut for *[attr=val]. So [name=enableTooltip]:checked will select any element that’s name attribute value is “enableTooltip” and is checked (:checked this implies that the element is an INPUT element of the type checkbox).

0

精彩评论

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

关注公众号