I've used this all the time in the past without any problems. I can't seem to figure out what's wrong this time; maybe I just need a second set of eyes.
This is my HTML code:
<form id="myForm">
<table>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
<tr>
<td>2014 HK Army Hardline Paintball Jersey</td>
<td>$89.95</td>
</tr>
<tr>
<td>Planet Eclipse 2013 Distortion Gloves</td>
<td>$34.95</td>
</tr>
<tr>
<td>Eclipse Geo 3.5 Paintball Marker</td>
<td>$1,600.00</td>
</tr>
</table>
<p>How many Paintball Jerseys would you like to order?</p>
<input id="jersey" type="number" value="0">
<p>How many Paintball Gloves would you like to order?</p>
<input id="gloves" type="number" value="0">
<p>How many Paintball Markers would you like to order?</p>
<input id="marker" type="number" value="0"><br>
<input type="button" onclick="submit()" value="Submit Form">
<input type="button" onclick="reset()" value="Reset Form"><br>
<p id="result"> </p>
</form>
And my JavaScript code:
function submit() {
document.getElementById("result").innerText = "hi";
}
Obviously I used "hi" as a test. It does not show up where my cursor is in p id="result" when I open the website up. Any suggestions are appreciated.
EDIT: I know it says document.getElementById("result").innerText = "hi";
, but I have tried it with .innerHTML
as well and still nothing.