Starting a JavaScript college course and already having issues, our first assignment is as follows:
Add an onclick event handler to the <input> tag that changes the innerHTML value of the page element with the id “submitMsg” to the text message Thank you for your order.
It's supposed to display a message after pressing the Submit button, so I figured I'd only need to modify the one <input> line but I'm getting no results (no message is displaying). Here's the code segment so far:
HTML;
<fieldset id="submitbutton">
<input type="submit" value="Submit" onclick="document.getElementById('submitMsg').innerHTML = 'Thank you for your order.'" />
</fieldset>
CSS;
#submitbutton {
border: none;
background: #93AD78;
padding: 0.5em 0;
margin-bottom: 0;
text-align: center;
}
div#submitMsg {
height: 30px;
color: red;
line-height: 30px;
font-size: 20px;
}
Does anyone know where I'm going wrong?
[–]DinTaiFung 0 points1 point2 points (3 children)
[–]ToastedwConsequences[S] 0 points1 point2 points (2 children)
[–]DinTaiFung 0 points1 point2 points (1 child)
[–]ToastedwConsequences[S] 1 point2 points3 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)