Jquery :getting Object Expected Error when using the onchange() for textfield -
i have textfield
<input type = "text" name ="text1" id ="text1" onchange="displayresult()"> function displayresult(){ alert("testing") }
it giving object expected error in ie6.o . when debug in mozilla pointing function name in way
`function onchange(event) { displayresult(); //the cursor pointed on here }`
how can correct
going description , example, think displayresult() function declaration below 'onchange' input text usage. solution below uses document.ready() event, , uses id selector , .change() register 'onchange' needs. can remove onchange="displayresult();" in html if use code below
<script> function displayresult(){ alert("testing"); } $(document).ready( function(event){ $("#text1").change(function(event){ displayresult(); }); }); </script>
Comments
Post a Comment