-
Selecting Elements by Attribute
You can use the attribute selector to select an element by one of its HTML attributes, such as a link’s target attribute or an input’s type attribute, etc. For example, the following jQuery code will select and highlight all the text inputs i.e. <input> elements with the type=”text”, when the document is ready. Example Selecting Elements by Compound CSS Selector You can…
-
jQuery Selectors
Selecting Elements with jQuery JavaScript is most commonly used to get or modify the content or value of the HTML elements on the page, as well as to apply some effects like show, hide, animations etc. But, before you can perform any action you need to find or select the target HTML element. Selecting the…
-
jQuery Syntax
Standard jQuery Syntax A jQuery statement typically starts with the dollar sign ($) and ends with a semicolon (;). In jQuery, the dollar sign ($) is just an alias for jQuery. Let’s consider the following example code which demonstrates the most basic statement of the jQuery. Example The above example simply displays an alert message…
-
Including jQuery from CDN
Alternatively, you can include jQuery in your document through freely available CDN (Content Delivery Network) links, if you don’t want to download and host jQuery yourself. CDNs can offer a performance benefit by reducing the loading time, because they are hosting jQuery on multiple servers spread across the globe and when a user requests the…
-
jQuery Getting Started
Downloading jQuery To get started, first download a copy of jQuery and include it in your document. There are two versions of jQuery available for downloading — compressed and uncompressed. The uncompressed file is best suited for development or debugging; while, the minified and compressed file is recommended for production because it saves the precious bandwidth and improves…
-
Advantages of Using jQuery
If you’re not familiar with jQuery, you might be wondering what makes jQuery so special. There are several advantages why one should opt for jQuery: Tip: In JavaScript, you often need to write several lines of code to select an element in an HTML document, but with jQuery robust selector mechanism you can traverse the DOM…
-
jQuery Introduction
jQuery is a fast, lightweight, and feature-rich JavaScript library that is based on the principle “write less, do more”. It’s easy-to-use APIs makes the things like HTML document traversal and manipulation, event handling, adding animation effects to a web page much simpler that works seamlessly across all the major browsers like Chrome, Firefox, Safari, Internet Explorer,…
