Skip to main content

Posts

Showing posts with the label jQuery

jQuery Selectors

How to find elements from HTML using jQuery In this article, you will learn about jQuery selectors and how to find DOM element(s) using selectors. The jQuery selector provides functionality to find DOM elements in your web page. jQuery selectors are one of the most important parts of the jQuery library. All selectors in jQuery start with the dollar sign and parentheses: $(). jQuery Selector Syntax $(selector expression) Example 1 : The .class Selector The jQuery .class selector allow you to finds all the elements with a specific class. If you want to find all the elements with class name "post-title" then the syntax will be as following. $(".post-title")   Example 2 : The #Id Selector The jQuery #Id selector allow you to finds the particular element with a specific Id. The Id selector will be used when you want to find single element from web page. $(document).ready(function(){ $("#btn-hide-title").click(function(){ $(".post-title").h