I want to see the input in a project and get the output at the same time. They did this only in the so-called way. But I want the output of my buttonless post. how to do?
<input type="text" id="myText">
<button type="button" onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
// Here the value is stored in new variable x
function myFunction() {
var x = document.getElementById("myText").value;
document.getElementById("demo").innerHTML = x;
}
</script>
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment