Multiple Attribute Selector [name=”value”][name2=”value2″]

attributeMultiple selector

Description: Matches elements that match all of the specified attribute filters.

  • version added: 1.0jQuery( "[attributeFilter1][attributeFilter2][attributeFilterN]" )

    attributeFilter1: An attribute filter.

    attributeFilter2: Another attribute filter, reducing the selection even more

    attributeFilterN: As many more attribute filters as necessary


Finds all inputs that have an id attribute and whose name attribute ends with man and sets the value.

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>attributeMultiple demo</title>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<input id="man-news" name="man-news">
<input name="milkman">
<input id="letterman" name="new-letterman">
<input name="newmilk">
$( "input[id][name$='man']" ).val( "only this one" );


© The jQuery Foundation and other contributors
Licensed under the MIT License.