jQuery | [attribute=value] Selector Last Updated : 26 Feb, 2019 Improve Improve Like Article Like Save Share 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. <!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. <!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: Like Article Suggest improvement Previous jQuery :first-of-type Selector Next HTML | DOM Input Date form Property Share your thoughts in the comments Add Your Comment Please Login to comment...