
March 24th, 2006, 03:50 PM
|
 |
Contributing User
|
|
Join Date: May 2004
Posts: 491
  
Time spent in forums: 4 Days 2 h 7 m 53 sec
Reputation Power: 12
|
|
|
Exerting style on innerHTML object
I am creating span tags on the fly in javascript. Each span is assigned an id. Once the script is done looping it prints this info to the screen. However, after the fact of printing - going to be based off of user input, I want to exert style(ie boldness, font-size, font-color) on a javascript generated tag: For example:
Code:
document.getElementById("test").innerHTML = "<span id=\"test\">SomeTest</span>";
document.getElementById("test").style.color = "#DDDDDD";
I've tried the above and doesn't seem to be working. Any suggestions?
Last edited by askjoe : March 24th, 2006 at 04:09 PM.
|