Multiple Attribute Selector Example

This tutorial explains how to multiple elements in jQuery . The multiple attribute selector selects multiple elements within a form. It matches all the specified attributes in the document and it specifies the multiple elements can be selected at once. The multiple attribute selectors can be used to refer to several attributes of an element or several times to the same element.

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


attribute Filter 1: An attribute filter.

attribute Filter 2: Another attribute filter, reducing the selection even more

attribute Filter N: 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.

<html lang="en">
   <meta charset="utf-8">
   <title>attributeMultiple demo</title>
   <script src=""></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");



Leave a Reply

Your email address will not be published. Required fields are marked *