<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Increase Decrease Button </title> <script type="text/javascript"> function incre(){ document.getElementById("qty").value++; } function decre(){ var ckVal = document.getElementById("qty").value; if(ckVal > '0') { document.getElementById("qty").value--; } } </script> </head> <body> <form name="DemoForm"> <input type='button' class="pull-left" name='incre' onclick='incre();' value='+'/> <input type='text' name='qty' value="1" id='qty' style="width:65px;" size="3" class="pull-left" /> <input type='button' class="pull-left" name='decre' onclick='decre();' value='-'/> </form> </body> </html>