$("selector").data("name", null);
console.log($("selector").data("name"));
This prints undefined.
Is there anyway to instantiate a null item in the jQuery data object of an element, not an undefined one?
Yes and Your code works fine, You should check if your $("selector") exists
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