$(document).ready(function(){ var number1=null; $(".procedure").click(function(number1){ if(number1==null){ alert(1); } }); });