I can use the jquery .data attribute and an alert confirms that it worked, but I don’t see data attribute in page using firebug.
$('#something').data('foo', 52);
alert($('#something').data('foo'));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The information put into
.data(...)is not a visible DOM attribute.You can view an object’s data by doing
console.log($('#something').data());Demo: http://jsfiddle.net/maniator/pQybU/