Home » JavaScript » jQuery (page 5)

jQuery

jQuery bind example

The aim of this example is to show you how to use the jQuery bind() method. This method is used to attach a handler to an event of HTML elements. This method has three overloaded signatures 1- .bind( eventType [, eventData ], handler ) The event type is the event name as “click”,”change”, etc. This method can bind one handler ...

Read More »

jQuery change example

The purpose of this example is to show you how to use the jQuery .change() method. The users of a dynamic web page make many operations to change HTML elements as the text entering into an input text field, the comboboxes selection, the checkboxes un/checking and so on. To detect these changes and get the changed HTML element’s value, we ...

Read More »

jQuery contains example

The aim of this example is to show you how to pick the DOM elements that contain a specific string. jQuery provides the :contains selector for this purpose. The jQuery :contains('text') selector helps you to find the HTML elements containing the given text. The text can be contained directly in the element or in a child element. For example, this ...

Read More »

jQuery Popup Window example 

The aim of this example is to show you how to use popup windows with jQuery. jQuery provides a good plugin that can be used for this purpose. A Popup window has a title and some content that may be a simple message or any HTML code (e.g. a login form etc.) The jQuery dialog() method is used to show ...

Read More »

Fun With jQuery: Create A Puzzle

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. Learning a new technology outside of the context of paid work can be challenging after writing code for business applications all day, so I ...

Read More »

jQuery forEach example

This example explains how to use iteration in jQuery. jQuery provides a powerful function for looping over elements. The jQuery each() function helps to iterate over an array, object properties and all HTML elements. This function has many overloaded signatures that take different arguments, all overloaded signatures take anonymous callback function to deal with current item. Let’s look at some ...

Read More »

jQuery get id example

The aim of this example is to show you how to get an element id using jQuery. The jQuery framework allows us to get an element id very easily. The element id must be unique in the HTML document. Getting it helps us in many situations like determining the pressed element or focused element in a page etc. The jQuery ...

Read More »

jQuery appendTo Example

The aim of this example is to explain and use jQuery’s .appendTo() method. What this method does, basically, is insert every element in the set of matched elements to the end of the target. This method is the opposite of .prependTo() which inserts HTML elements at the beginning of the selected elements. This method is used to dynamically insert content ...

Read More »

jQuery Selector Example

The aim of this example is to go through some of the most important and used jQuery selectors widely used over websites to achieve specific results depending on the case. Selectors can be considered as identifiers for jQuery to match what is written in the quotes with what is actually part of the document, and not necessarily what we write ...

Read More »