In Jquery we allowed accessing the element by its class or ID. If we use the help of class means the '.'(dot) followed by class name will help us to access the information. If we use ID means, the '#'(hash) followed by ID name help us to load the element object. The below is the accessing element property.
Setting a cookie using jQuery is quite easy. This can be done with the help of jQuery Cookie Plugin. $.cookie() is used to set and get a value from a cookie. ownload the "jquery.cookie.js" from.,
Binding an event to an iframe element is possible using contents() method. Here i am attaching an keyup event to a body field inside an iframe. Checkout the sample code below...
The currency field only accepts numeric values with decimal point of two digits. Below is the JQuery code to validate normal textfield as Currency field, will accepts only numbers and dot followed by two digits.
The below is the sample code in JQuery used for making Textfield only allow numeric values.
To detect the event when text change inside the any HTML element like div, span, table or etc., using DOMNodeInserted, DOMContentLoaded, DOMSubtreeModified and DOMNodeRemoved events. These events are known as Mutation events. Below is the sample code of handling Mutation events on different browsers.
Finding Click outside an element is quite easy. We need to register click event for the whole window then prevent the click on the specified element using event.stopPropagation().
jQuery setTimeout can be used if we need a delay in our code. It executes the code with a delay of specified time in milliseconds. Normally 1 second is equal to 1000 millisecond. This function accepts the first argument as a reference to a function.