jQuery | [attribute=value] Selector Last Updated : 26 Feb, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The jQuery [attribute=value] selector is used to select and modify HTML elements with specified attribute and value. Parameter Values: attribute: Used to specify attribute to find. Value: Used to specify value to find. Syntax: $("[attribute=value]") Example-1: This example selects the elements having id GFG and adds a border to it. html <!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function() { $("[id=GFG]").css( "border", "5px solid green"); }); </script> </head> <body> <h2 id="GFG"> GeeksForGeeks </h2> </body> </html> Output: Example-2: This example changes the text color of elements having a class attribute with value GFG. html <!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function() { $("[class=GFG]").css( "color", "green"); }); </script> </head> <body> <h2 class="GFG"> GeeksForGeeks </h2> </body> </html> Output: Comment More infoAdvertise with us Next Article jQuery [attribute^=value] Selector A aman neekhara Follow Improve Article Tags : Web Technologies JQuery jQuery-Selectors Similar Reads jQuery [attribute^=value] Selector The jQuery [attribute^=value] selector is used to select all elements with a given attribute specified by an attribute parameter that starts with the word specified by value parameter. Syntax: $("[attribute^='value']")Parameters: This selector contains two parameters which are listed below: attribut 2 min read jQuery [attribute!=value] Selector The jQuery [attribute!=value] selector in jquery is used to select each element that doesn't have the specified attribute and value. Syntax: $("[attribute!='value']")Parameter: attribute: This parameter is required to specify the attribute to be searched.value: This parameter is required to specify 1 min read jQuery [attribute$=value] Selector The jQuery [attribute$=value] selector is used to select each element with a specific attribute, with a specific ending string. Syntax: $("[attribute$='value']")Parameter: attribute: This parameter is required to specify the attribute to find.value: This parameter is required to specify the string i 1 min read jQuery [attribute*=value] Selector jQuery ("[attribute*=value]") Selector is used to select all elements with attribute specified by attribute parameter that contains the word specified by the value parameter. Syntax: $("[attribute*='value']")Parameters: This selector has two parameters. attribute: attribute specifies the attributes 2 min read jQuery [attribute|=value] Selector The jQuery [attribute|=value] selector is used to select each element with a specific attribute, with a specific string value (like "geeks") or starting string followed by a hyphen (like "geeks-forgeeks"). Syntax: $("[attribute|='value']")Parameter: attribute : This parameter is required to specify 1 min read jQuery [attribute~=value] Selector jQuery [attribute~=value] Selector Select all elements with a name attribute that contains the specific string. Syntax: $("[attribute~='string']")Parameter: attribute: Specifies which attribute is used to find.string: Specifies the string value to find.Example 1: In this example, we will select all 1 min read Like