Created
August 25, 2009 15:43
-
-
Save micmath/174773 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paras = $("p"); | |
// all paras get object with cherry flavor | |
paras.data("desert", { flavor: "cherry" }); | |
// modify flavor property of the first para | |
$(paras.get(0)).data("desert").flavor = "lime"; | |
// see flavor property of the second para | |
console.log( $(paras.get(1)).data("desert").flavor ); // it's lime | |
// all paras get primitive value with size | |
paras.data("size", "grande"); | |
// modify the size on the first para | |
$(paras.get(0)).data("size", "vente"); | |
// see size property of the second para | |
console.log( $(paras.get(1)).data("size") ); // it's grande |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment