Reputation: 11
document.body.style.backgroundImage = "url('images/background52.jpg')";<br>
I tried in this way.but it is not working properly.
Upvotes: 0
Views: 32
Reputation: 2896
You are adding a html tag <br>
in your javascript, see the console and you will see an error like
Uncaught SyntaxError: Unexpected token <
Get rid of <br>
and it will work.
Upvotes: 1