Wednesday, June 9, 2010

Jquery.Data

Learning new stuff today..from Rob...

It's better to use Jquery.Data instead of custom attribute in element.
because it will break some browser for custom attribute which not standard.

Thanks Rob..

Here is the example

jQuery.data(div, "test", { first: 16, last: "pizza!" });
$("span:first").text(jQuery.data(div, "test").first);
$("span:last").text(jQuery.data(div, "test").last);

No comments: