Javascript examples for DOM HTML Element:Input Text
Update input text box content
<html> <head> <script> function inc()/*from w ww. j av a2 s . c om*/ { document.content.quant.value++; event.preventDefault(); } function dec() { document.content.quant.value--; event.preventDefault(); } </script> </head> <body> <form name="content"> <input type="text" id="quant" value="0"> <button onclick="inc()">increase</button> <button onclick="dec()">decrease</button> </form> </body> </html>