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.
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.