JavaScript Forms Question - Select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CeleronXT
    Senior Member
    • Mar 2002
    • 3217

    JavaScript Forms Question - Select

    I currently have a select box generated through JavaScript and I'm trying to set a certain <option> to selected. Currently I'm using document.getElementById('categories').selected = 'selected', which works in IE and Fx. It doesn't work in Opera, though.

    Is there a more standard way of doing this? I just made up the selected = 'selected' thing and it worked, but I wonder if there's a preferred way of doing this.
    "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
    "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
    Utopia Software - Current Software: Utopia News Pro (news management system)
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...