Easy Tutorial
❮ Misc Callbacks Locked Event Dblclick ❯

jQuery Selector [name="value"][name2="value2"]

jQuery Selectors

Example

Find input fields that match the compound selector and set their values.

<input id="man-news" name="man-news" />
<input name="milkman" />
<input id="letterman" name="new-letterman" />
<input name="newmilk" />
<script>
$(function () { 
    $( "input[id][name$='man']" ).val( "只有这个输入框" );
})
</script>

Definition and Usage

[name="value"][name2="value2"] is a compound attribute selector used when multiple conditions need to be met simultaneously.


Syntax

Parameter Description
attributeFilter1 Selector type attribute selector
attributeFilter2 Selector type another attribute selector to further narrow down the selection
attributeFilterN Selector type any number of attribute selectors

jQuery Selectors

❮ Misc Callbacks Locked Event Dblclick ❯