Javascript Event Listener on click not working as expected

前端 未结 5 454
感动是毒
感动是毒 2021-01-20 15:54

I\'m trying to create one event listener to handle all my \"clicks\" by putting it on the body and doing some event delegation. A simple example of what i\'m trying to do i

5条回答
  •  独厮守ぢ
    2021-01-20 16:39

    If you click li ,you are current 2 step childnodes from parentNode div#div1

    div#div1 > ul > li[current target] //back parentNode to 2 times
    
    
    

提交回复
热议问题