How to remove $(document).on click event?

前端 未结 7 1992
孤独总比滥情好
孤独总比滥情好 2021-01-06 08:13

Here is the code to add event

   $(document).on({
      click: function() {
        $(this).hide();
        $(\'#form_name\').removeClass(\'hide\');
                 


        
相关标签:
7条回答
  • 2021-01-06 09:08

    Try this:

    $('.form-template-name').unbind("click"", event);
    

    and define the click event as:

    var event = function() {
        $(this).hide();
        $('#form_name').removeClass('hide');
        $('#form_template_name')
          .attr('placeholder', $(this).text())
          .focus();
    };
    

    Then use it as you did before.

    0 讨论(0)
提交回复
热议问题