How do you change a CSS property using JavaScript?
Ans: Take the property, say text-indent, remove the hyphen(s), and convert
the capitalization to camel casing: textIndent. Then change it in JavaScript
like this:
document.getElementById(idnum).style.textIndent = 1cm;
Which CSS property can make an element invisible?
Ans: visibility.
Guess how to change the page title dynamically.
Ans: document.title = New Title;
How do you change the text in an HTML element?
Ans: document.getElementById(idnum).innerHTML = New text;
Use the mousedown and mouseup events and
two images to simulate pressing and releasing
a button. Also incorporate the mouseover and mouseout
events to change an image.
To change the page with JavaScript, change the
document.URL property.
Changing Background Color Dynamically
Change the background color by using the getElementById function
to get the body and then changing the backgroundColor property of
the body style. Use a user defined rgb function to get the hex color
code corresponding to r, g and b values.