Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 613
Travis Pessetto Avatar asked Aug 24 '11 15:08

Travis Pessetto


1 Answers

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

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

like image 152
jensgram Avatar answered Sep 21 '22 11:09

jensgram