var that = []; $( '#a1,#a2,#a3').one('click', function(){ that[$(this).index()] = $(this); c_down($(this).index()); } ); var c_down = function(index){ num = that[index].data('num')-0; if( num> 0 ){ num --; that[index].text('已发送'+ num).data( 'num', num ); setTimeout( 'c_down('+index+')', 1000 ); }else{ num =60; that[index].text('重新发送').data( 'num', num ).one('click',function(){c_down( $(this).index() )}); } }