I wrote some html/css/javascript code that was taken verbatim from a javascript textbook. For some reason, the code does not run correctly in my browser (which is the newest version of Firefox). When I click the button, the javascript function "toggleStyle()" does not execute in the browser at ALL. This is the code for the button:
<button type="button" onclick="toggleStyle()">Toggle Style</button> This is the javascript coding. Note that when I click the button, not even the alert() method is executed:
function toggleStyle() { alert("toggleStyle() is working."); var divMessage = document.getElementById("divMessage"); if (divMessage.className === "message-style1") { divMessage.className = ""; } else { divMessage.className = "message-style1"; } 
Ctrl+Shift+J(if on Windows) to bring up any possible errors or warnings that may be causing the code to execute improperly. See: developer.mozilla.org/en/Error_Console if it isn't enabled for you by default.}to end the function?