I am using jQuery 1.4.4. and I have this source code:
<div id="area1">
<ul id="testlist" data-filter="false">
</ul>
</div>
How can I change the data-filter attribute to true in jQuery? I tried for example:
$('#testlist').attr("data-filter").val(true);
but it does not work.
Anyone an idea?
Best Regards.
The syntax for attr is $.attr(attributeName, value);
. Try this:
$('#testlist').attr("data-filter", true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With