Setting stylesheet for dynamically created object
Hai
I created a select option(combo box) dynamically using javascript. I want to set the stylesheet class for that. so any one can tell how we can do it
the code i tried
var el = document.createElement('select');
el.setAttribute('name','os');
var newOptionElement = document.createElement("option");
newOptionElement.setAttribute("value", "value");
newOptionElement.innerHTML = "value";
el.appendChild(newOptionElement);
el.style.className='text'
i defined text in my css as following
.font8ptNorm {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
}
Thanks
T.Gopalakrishnan
|