js background 1

js background

document.body.style.background = "#f3f3f3 url('img_tree.png') no-repeat right top";

Here is what the above code is Doing:
1. The first line is a comment. Comments are ignored by the browser.
2. The second line is a JavaScript statement which changes the text in the

element:
document.getElementById(“demo”).innerHTML = “Hello JavaScript”;
3. The third line is a JavaScript statement which changes the background image of the document:
document.body.style.background = “url(‘img_tree.png’) no-repeat right top”;

Similar Posts