For those who DO NOT need an input block, here is an example ready for compilation that you can check, which simply counts the button presses, updates them in the text and switches the font. You can take the value and use it anywhere.
<!DOCTYPE html> <html> <body> <p id="demo">JavaScript can change the style of an HTML element.</p> <script> function incrementValue() { var demo_id = document.getElementById('demo') var value = parseInt(demo_id.value, 10); </script> <form> <input type="button" onclick="incrementValue()" value="Increment Value" /> </form> </body> </html>
source share