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'));
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'));
The information put into .data(...)
is not a visible DOM attribute.
You can view an object's data by doing console.log($('#something').data());
jQuery doesn't actually add a data attribute as such to the element and so there is nothing in the DOM that firebug can display.
As Neal points out you can log the data to console to verify that it is in fact there.
Alternatively you can install a Firebug extension such as FireQuery (http://firequery.binaryage.com/) to directly display jQuery data in Firebug itself.