Hiding parent divs in Jquery

后端 未结 3 739
走了就别回头了
走了就别回头了 2020-12-06 03:03

I am having a simple div structure ( see below ). All I am trying to do is when the div id \"interviewer-Button\" is clicked the following div\'s should appear and when the

3条回答
  •  一整个雨季
    2020-12-06 03:22

    You can also take advantage of event propagation and attach just one event:

    $(function() {
      $("#parent0").hide(); 
      $("#interviewer-Button").on('click', function(e){
        $(this).find('#parent0').toggle(e.target.id !== 'elt');
      });
    });
    

提交回复
热议问题