Return to Snippet

Revision: 26934
at May 17, 2010 07:13 by neal_grosskopf

Initial Code
//Store information
$("input").data("original", "$1.75");
$("input").data("currency", "$1.50");
$("input").data("decimal", 1.5);

//Retrieve information

//Shorthand store
$("input").data("numbers",{original: "$1.75", currency: "$1.50", decimal: 1.5});

//Shorthand retrieve

Initial URL

Initial Description
jQuery has a built in method that allows developers to store information inside elements. Learn how to use the .data() method and view some examples of how this can be used.

Initial Title
jQuery's .data() Method - Store Information Inside Elements

Initial Tags

Initial Language