javascript - JS using ele.style.backgoundImage = '' ='none' to cancel the background image is invalid
高洛峰2017-07-05 10:44:32
0
6
1164
Using ele.style.backgoundImage = '' ='none' in JS to cancel the background image is invalid. What method should be used to cancel the background image in JS?
Changed to
bgNode.style.backgroundImage = "none";
style.backgroundImage = 'none';
ele.style.backgroundImage='none'; After the page is loaded, execute $(function(){)};
ele.style.backgoundImage = 'none' is fine, no need to add an extra equal sign
First make sure to decide whether to leave or not.
$(ele).css('background-image','none');