[thelist] Insert CSS class with JavaScript

Simon Willison cs1spw at bath.ac.uk
Tue Dec 2 21:59:04 CST 2003

Peter Abramowicz wrote:

> Here is a problem, I am generating 'OPTION' tags with JavaScript, based on an info from MySQL database. 
> I need to insert CSS class into the new tags. So far I wasn't able to came up with any way that works.
> If anyone has any ideas I would really appreciate your input.

selectCtrl.options[j].className = 'whatever'; should do the trick.

More information about the thelist mailing list