jquery - Prevent onChange of a textbox onClick of a button -


i have textbox , button. have binded onchange event textbox , click event on button. want avoid textbox's onchange event when user clicks on button.

<asp:textbox id="txt1" runat="server"/> <asp:button id="btn1" runat="server" text="submit"/> 

jquery

$("txt1").bind("change", function(){ // work; });   $("btn1").bind("click", function(){ //avoid on change event of textbox }); 

try this

$("#btn1").bind("click", function(){    $('#txt1').unbind('change'); }); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -