$(document).ready(function(){ $(".btn1").toggle(function(){ alert("0000"); },function(){ alert("111") } ); });