I'm building a basic website. One of the requirements is that the user enters a number, which is processed by JavaScript and then the processed data is output. Here is what I've come up with:
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = form.inputbox.value+1;
// Here, I want to return TestVar as a h1 tag in HTML
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults(this.form)">
</FORM>
</BODY>
</HTML>
So that's what I want to do. I'm sorry if this is a stupid question; I'm new to web dev. Thanks