So what I've been trying to do is have a drop-down menu with options in it and have some text display depending on which option is selected.
I came to the conclusion of using HTML and JavaScript to do it, but I am having trouble.
For the HTML, I have this -
<select id="selectDay">
<option>Choose a Day</option>
And for the JavaScript I have this - `
var select = document.getElementById("selectDay");
var response1 = ("Response if a Day between Monday through Friday is Selected");
var response2 = ("Response if Saturday or Sunday are selected");
var days = ["Sunday", "Monday", "Tuesday", "Wednesday" , "Thursday", "Friday", "Saturday"];
for(var i = 0; i < days.length; i++)
{
var opt = days[i];
var el = document.createElement("option");
el.textContent = opt;
el.value = opt;
select.appendChild(el);
}
I got this far mainly through use of Google, but I'm stumped now. I'm just trying to do this so I can say I completed a project. I'm not even sure if I'm doing it correctly.