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

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

2
  • Why is there a <br> after the semicolon? That should cause an error. Also, try hitting F12 and clicking on "Console" in your browser (assuming Chrome) to see if it displays any errors Commented Feb 28, 2016 at 20:02
  • Can you post more than that simple snippet? Commented Feb 28, 2016 at 20:02

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.