when javascript function alter html input text ,I want the input text trigger a event like calling other JS function -
i try use onchange work when alter text focusing mouse cursor on , when alter text using function not anything
<input type="button" value="testbutton" onclick="altertext()" /> <br /> <input id="txtbox1" type="text" onchange="alertme()" /> <script> var counter = 0; function altertext(){ counter=counter +1; document.getelementbyid('txtbox1').value = counter; } function alertme(){ alert("done!.."); } </script>
you can call yourself.
var counter = 0; function altertext(){ counter=counter +1; document.getelementbyid('txtbox1').value = counter; alertme.call(document.getelementbyid('txtbox1')); } function alertme(){ alert("done!.."); }
Comments
Post a Comment