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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -