Ok so I have a code that would show different forms based on dropdown selection Here\'s the fiddle to that..
Well its always giving me Test1 which means its not cha
The page is loaded into the DOM from the top down.
Your document.getElementById('options').onchange is being called before the element with id options exists in the DOM.
document.getElementById('options').onchange
options
If you put your script below the divs, it'll work because the divs are now there before the script is called.