Multiple attribute selector [name=”value”][name2=”value2″]

Matches elements that match all of the specified attribute filters.
jQuery( "[attributeFilter1][attributeFilter2][attributeFilterN]" )
version added: 1.0
Examples:

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

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>attributeMultiple demo</title>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<input id="man-news" name="man-news">
<input name="milkman">
<input id="letterman" name="new-letterman">
<input name="newmilk">
 
<script>
$( "input[id][name$='man']" ).val( "only this one" );
</script>
 
</body>
</html>
doc_jQuery
2016-03-27 13:48:47
Comments
Leave a Comment

Please login to continue.