Using Javascript with HTML drop-down select
I am having problems using data from a dropdown list with my JavaScript. I want it to print out on the page based off what is selected, but so far when they select a value, nothing happens. I am new to JavaScript, please help: <form> <select name="abc" id="abc" onChange="check(this.form)"> <option value="a">A</option> <option value="b">B</option> <option value="c">C</option> </select> </form> <script> function check (form){ var letter = document.getElementById("abc"); var userLtr = letter.options[letter.selectedIndex].value; if (userLtr == "a"){ document.write ("You selected A"); } else if(use
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.