Search within TutorialsPark

Jquery Utility Functions

Learn to use jQuery Utility Functions to perform a number of daily use tasks

jQuery : Utility Functions

The jQuery Provides a number of utility functions which can be used to perform certains JavaScript Task easier.

These jQuery functions can perform the tasks in few lines of code, while the same would require more lines of code and time with JavaScript.

jQuery Utility: Looping Over Objects using $.each() Method

The jQuery function $.each() is used to automatically loop over all members of an object.

Using this function you need not know the name of each object member to access it, you can loop over every member automatically.

Example: Looping Over Object using $.each() Function

Give it a TRY! » Note: It executes callback for each item in the collection

jQuery Utility : Getting the Index Number using index() Function

The jQuery index() function is used to search for a given DOM node from among the matched elements.

It returns the position of the element within the jQuery object, if nothing is found then -1 is returned

Example: Getting the Index Number using index() Function

Give it a TRY! » Note:It accepts a DOM node as a parameter.