I am having the same issue and I am trying to implement your JavaScript but it is not working properly I have your entire code on my webpage and have replaced the 0 with -1 because I have no default option, I also renamed the oneSelect( 's1', 's2', 's3' ); to the appropriate select ids. Any idea why this wouldn't work? Here is snippets of the HTML in which implement the JavaScript

Re your problem: as Ali says, place the code anywhere below all the involved elements.As it is, your script is trying to reference elements which don't exist in the DOM.Swap the script and the HTML around and all will be well.