Original Post
I'm working on having a select box with two options (yes and no). I wanna use javascript so when the select box drops down, and someone clicks yes, an event happens, and when the user clicks no, a different even happens. Heres my code atm. (The i value being passed is to detect which select box it is as I have multiple). function nameOfFunction(i) { var start = document.getElementById("start"+i); var end = document.getElementById("end"+i); if(document.form1.available[0].text = "Yes") { alert("Yes value"); } if(document.form1.available[1].text = "No") { alert("No value"); } } What currently happens is no matter what value I click on in the select, both alerts appear. Thanks