简体   繁体   中英

JQuery combine attribute selectors

I have a Javascript that I am working on and I would like to combine two selectors so that they refer to this tag only:

<input name="checkable" type="checkbox">

So that only checkable with type checkbox will react to it while a text-field with a name of checkable will not. I have tried:

$("input[name='checkable' type='checkbox']")

with no success. Any ideas on how I can do this?

$("input[name='checkable'][type='checkbox']")

Cf. Multiple Attribute Selector [name="value"][name2="value2"] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM