Can someone please help me troubleshoot this code? I'm unable to figure out what's going wrong. The concept is to take user input, assign it to a variable, and then display a string. However, nothing appears on the screen after entering a name.
Welcome! This platform aims to improve the process of searching for POU Kit Parts:
<form id="form1">
<p>Please enter your name: <input name="name" type="text" size="20"></p></form>
<p><button onclick="outputname()"> Submit</button></p>
<script>
function outputname(){
var x,name,a,b,answer,y;
x=document.getElementById("form1");
y=x.elements["name"].value;
document.write("Hello " +y+ );
}
</script>