I have an interesting problem that I don't understand. It's a simple jQuery if else statement, but it's not working. Why is it not working?
Code:
$("#div").click(function(){
if ( $("#div2").css("background-image") === "url(img/image.png)") {
alert('OK');
}
else {
alert('NG');
}
});
But when I change .css("background-image") === "url(img/image.png)", for example, to .css('position') === 'absolute', it's working.
$("#div2").css("background-image")..css('height') === 'absolute'ever work?