Can you change with code the CSS class of an object after the web page has been downloaded? Does anybody know how?!
Thank you! :)
Printable View
Can you change with code the CSS class of an object after the web page has been downloaded? Does anybody know how?!
Thank you! :)
You can in DOM 3. I'm not sure about the current standards.
www.w3c.org
developer.netscape.org
What is DOM 3?!?
Its the Document Object Modal, a way of addressing an element/Tag on a HTML Page.
If you had this code...
<body>
<input type="text" name="text1">
</body>
... you can use the DOM and a scripting language such as Javascript to get the value in the text...
alert (document.all("text1").value);
...This would display a popup msg with the contents or text1.
document indicates the page your working on
all("text1") searching all elements on a page until it finds a item named 'text1'. all is only really used in Internet Explorer 4 +, I prefer getElementById but only modern browsers support it
value returns/sets the value of item
Check out CiberTHuGs link for more info
Set the "className" attribute of an HTML element.
Thank you... the className works perfect! :)