89
rated 0 times
[
94]
[
5]
/ answers: 1 / hits: 154313
/ 12 Years ago, wed, october 31, 2012, 12:00:00
How do I set a data attribute without adding a value in jQuery? I want this:
<body data-body>
I tried:
$('body').attr('data-body'); // this is a getter, not working
$('body').attr('data-body', null); // not adding anything
Everything else seems to add the second arguments as a string. Is it possible to just set an attribute without value?
More From » jquery