<input type="text" id="text" disabled value='0'> <button id="btp" disabled>Go Next</button> <script> onclick = function(){ document.querySelector('#btp').disabled = document.querySelector('#text').value++<=1000; }; </script>