I'm quite new to programming (started yesterday) and so far I've just created a very simple code. I am currently unaware on how to make it so I can click enter and it will submit the forum post so any commands on how to make that possible would be greatly appreciated :)
<!DOCTYPE html>
<html>
<head>
<title>Title Changing Simulator!</title>
<script type="text/javascript">
function substitute() {
var myValue = document.getElementById('myTextBox').value;
if (myValue.length == 0) {
alert('Please enter a real value in the text box!');
return;
}
var myTitle = document.getElementById('title');
myTitle.innerHTML = myValue;
}
</script>
</head>
<body>
<h1 id="title">Title Changing Simulator!</h1>
<input type="text" id="myTextBox" />
<input type="submit" value="Click My Button" onclick="substitute()" />
</body>
</html>