jQuery element Selector Last Updated : 28 Jul, 2025 Comments Improve Suggest changes Like Article Like Report jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, it simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development. jQuery element selector is used to select and modify HTML elements based on the element name. Syntax: $("element_name") Example 1: This example selects the "h2" element 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 () { $("h2").css("border", "5px solid green"); }); </script> </head> <body> <h2>GeeksForGeeks</h2> </body> </html> Output: Example 2: This example changes text color of "h2" element on button click. 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 () { $("button").click(function () { $("h2").css("color", "green"); }); }); </script> </head> <body> <h2>GeeksForGeeks</h2> <button>Change text color</button> </body> </html> Output: Supported Browsers: Google Chrome 90.0+Internet Explorer 9.0Firefox 3.6Safari 4.0Opera 10.5 Comment More info A aman neekhara Follow Improve Article Tags : Web Technologies JQuery jQuery-Selectors Explore jQuery Tutorial 8 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like