I just posted this question a few hours ago and got helpful responses, both codes displayed the output the way I needed, but after editing my code (even tried copy-pasting the working code into Dreamweaver) I couldn't replicate the successful result on my laptop.
So I thought of putting it up on JSFiddle, and since my desktop PC was already logged into my email, I made the JSFiddle account on there and ran the code successfully, now I try running the same fiddle (link) on my laptop and it won't display the output (just like Dreamweaver wouldn't). The only difference (software-wise) between the two computers is that the laptop has Dreamweaver 2015 installed and the desktop doesn't.
I'm stumped, have any of you run into a similar issue before? is there something I'm missing? all suggestions appreciated.
for reference (and since I apparently can't link to JSFiddle without posting code), here's the code I'm trying to get to work.
<script type="text/javascript">
console.clear();
function showDetails(event) {
console.log(event);
var x = event.srcElement;
var val = x.options[x.selectedIndex].text;
var t = event.srcElement.selectedOptions[0].text;
document.getElementById("Details").value = t;
}
var el = document.getElementById("slctOrder");
el.addEventListener("change", showDetails, false);
</script>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Hot Buns </title>
</head>
<div>
<h2> Welcome to Hot Buns </h2>
<h3> Ham can we bee'f service? </h3>
</div>
<div>
<h2> Place an order </h2>
</div>
<form method="get" id="frmOder">
<select id="slctOrder">
<option hidden selected="selected" value="0"> please select one of today's specials </option>
<option value="1"> Last of the Mo-jicama </option>
<option value="2"> Cheesus Is Born Burger </option>
<option value="3"> Beets of Burden Burger </option>
<option value="4"> Paranormal Pepper Jack-tivity Burger </option>
</select>
<output id="Details" />
</form>
</body>
</html>
Yes, it's a known issue that happens on certain installs of Dreamweaver.
Dreamweaver changes things in the registry that have certain effects on loading CSS, etc. this answer should help you fix it.