$("#btnClick").on( "click", function(e) { alert( "This alert will be displayed only once." ); $(this).val("No use of clicking now!"); $(this).off(e); }); $("#btnClickOne").one( "click", function(e) { alert( "This alert will be displayed only once." ); $(this).val("No use of clicking now!"); });
<input type="button" value="Click Me(using on/off)" id="btnClick" /> <input type="button" value="Click Me(using one())" id="btnClickOne" />