i am quite new to jquery. i am trying to check on page load if data attribute has a value or is that empty. here is my html
data-tablet="img/xl.jpg"
How i wanna check if there is a path set or is it empty. here is my js
if ($('#myImg').data('tablet')=null) {
alert('Path not Set');
};
But it's giving me an error. can you please tell me how to resolve it. thanks.
=is assignment,==is equality and===is identity