EN
JavaScript - get input field value
4
points
In this short article, we would like to show how to get input value using JavaScript.
Quick solution:
// ONLINE-RUNNER:browser;
<input id="my-input" value="Some text here ..." />
<script>
var element = document.querySelector('#my-input');
console.log(element.value); // Some text here ...
</script>