Can't find the issue, select 2 isn't corresponding with Select 1
ï»żï»ż<!DOCTYPE html> <html lang="en"> <head> <script type="text/javascritp"> function populate(s1,s2){ var s1 = document.getElementById(s1); var s2 = document.getElementById(s2); s2.innerHTML = ""; if(s1.value == "Chevy"){var optionArray = ["|","camaro|Camaro"];} else if(s1.value == "Dogde"){var optionArray = ["|","avanger|Avanger"];} else if(s1.value == "Ford"){var optionArray = ["|","mustang|Mustang"];} for(var option in optionArray){var pair = optionArray[option].split("|"); var newOption = document.createElement("option"); newoption.value = pair[0]; newoption.innerHTML = pair[1]; s2.options.add(newoption); }</script> </head> <body> <h2>Choose Your Car</h2> Choose Make: <select id="slct1" name="slct1" onchange="populate(this.id,"slct2")"> <option value=""></option> <option value="Chevy">Chevy</option> <option value="Dogde">Dogde</option> <option value="Ford">Ford</option> </select> Choose Car Model: <select id="slct2"