+ 1
how to take an input in Java script
2 Answers
+ 2
var text = prompt("Please enter your text.", "default value");
+ 2
If you are trying to get a normal input/form from html first:
<input id="name">
Then use the js:
<script>
var a=document.getElementById("name");
</script>
or if you want to make it an if statement
var a=document.getElementById("name").value;
if (a==="your name"){
//your code here
}