0

I'm trying to remove the background-image attribute with jQuery but I had no success until now. The '::after' don't let me remove-it. How I can do that?

body::after { background-image: url(../images/16_sm.jpg); }

user3108967
  • 43
  • 1
  • 15

2 Answers2

1

Try like this,

Html:

<body class='test'>

Css:

.test::after{
 background-image: url(../images/16_sm.jpg);
}

Js:

$('body').removeClass('test');
Rajaprabhu Aravindasamy
  • 66,513
  • 17
  • 101
  • 130
-1

Try this.

$(body).css("background-image", "");

or

$(body).css("background-image", "none");
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
wramirez09
  • 32
  • 5