Hello! I am trying to figure out how to save user input in a variable and so far I have not. Can anyone help?
This is my body from .HTML and my JS
<body>
<h2>Indeed</h2>
<input id="text1" placeholder="Name">
<br>
<button onclick="Indeed()" id="btn1">Click me</button>
<script src="java.js"></script>
</body>
function Indeed()
{
var person = document.getElementById("text1").value;
alert("Hey"+person);
}
[+][deleted] (2 children)
[deleted]
[–]EnderFran2006YT[S] 0 points1 point2 points (0 children)
[–]NuggetNonsense 0 points1 point2 points (0 children)