In earlier article I have explained about storing the data in HTML element using MooTools. Now I am going to cover the same feature with the jQuery.
So now lets start with the Element Storage in jQuery.
With these type of storage we gets free from memory leak. These data will gets removed when we remove that element from the DOM or user leaves/refresh the page.
We can store the data using key value pair in any DOM element. We can store anything like single variable, array, object, etc.
Here are the two methods to achieve this:
This method takes three parameter.
1) Object of Element
3) Actual value which we want to store
This way is almost same as previous one, except in this method we will call with reference of object of an element.
So this methos will need only two parameters.
2) Value which we want to store
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash