Home  >  Q&A  >  body text

javascript - JS using ele.style.backgoundImage = '' ='none' to cancel the background image is invalid

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?

高洛峰高洛峰2662 days ago1225

reply all(6)I'll reply

  • 三叔

    三叔2017-07-05 10:46:32

    Changed to
    bgNode.style.backgroundImage = "none";

    reply
    0
  • 迷茫

    迷茫2017-07-05 10:46:32

    style.backgroundImage = 'none';

    reply
    0
  • 世界只因有你

    世界只因有你2017-07-05 10:46:32

    ele.style.backgroundImage='none'; After the page is loaded, execute $(function(){)};

    reply
    0
  • typecho

    typecho2017-07-05 10:46:32

    ele.style.backgoundImage = 'none' is fine, no need to add an extra equal sign

    reply
    0
  • 漂亮男人

    漂亮男人2017-07-05 10:46:32

    First make sure to decide whether to leave or not.

    reply
    0
  • typecho

    typecho2017-07-05 10:46:32

    $(ele).css('background-image','none');

    reply
    0
  • Cancelreply