Helmet Hide: Difference between revisions
Appearance
Created page with "'''Coming Soon'''" |
No edit summary |
||
| Line 1: | Line 1: | ||
<select id="myDropdown" onchange="updateContent()"> | |||
<option value="">Select one</option> | |||
<option value="one">Option 1</option> | |||
<option value="two">Option 2</option> | |||
<option value="three">Option 3</option> | |||
</select> | |||
<div id="output" style="margin-left:20px; display:inline-block;"> | |||
Pick something above | |||
</div> | |||
<script> | |||
function updateContent() { | |||
var value = document.getElementById("myDropdown").value; | |||
var output = document.getElementById("output"); | |||
if (value === "one") { | |||
output.innerHTML = "This is content for Option 1"; | |||
} else if (value === "two") { | |||
output.innerHTML = "This is content for Option 2"; | |||
} else if (value === "three") { | |||
output.innerHTML = "This is content for Option 3"; | |||
} else { | |||
output.innerHTML = "Pick something above"; | |||
} | |||
} | |||
</script> | |||
Revision as of 13:44, 21 April 2026
<select id="myDropdown" onchange="updateContent()">
<option value="">Select one</option> <option value="one">Option 1</option> <option value="two">Option 2</option> <option value="three">Option 3</option>
</select>
Pick something above
<script> function updateContent() {
var value = document.getElementById("myDropdown").value;
var output = document.getElementById("output");
if (value === "one") {
output.innerHTML = "This is content for Option 1";
} else if (value === "two") {
output.innerHTML = "This is content for Option 2";
} else if (value === "three") {
output.innerHTML = "This is content for Option 3";
} else {
output.innerHTML = "Pick something above";
}
} </script>