Naveen bhat
Naveen bhat

Reputation: 11

adding background images in js file for website

         document.body.style.backgroundImage = "url('images/background52.jpg')";<br>

I tried in this way.but it is not working properly.

Upvotes: 0

Views: 32

Answers (1)

drosam
drosam

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

Related Questions