Registering jQuery click, first and second click

前端 未结 9 903
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 23:23

Is there a way to run two functions similar to this:

$(\'.myClass\').click(
    function() {
        // First click
    },
    function() {
        // Second         


        
9条回答
  •  隐瞒了意图╮
    2020-11-30 00:13

                var click_s=0;
                $('#show_pass').click(function(){
                    if(click_s % 2 == 0){
                        $('#pwd').attr('type','text');
                        $(this).html('Hide');
                    }
                    else{
                        $('#pwd').attr('type','password');
                        $(this).html('Show');
                    }
                    click_s++;
                });
    

提交回复
热议问题