How does JQuery's .click() work behind the scenes?

前端 未结 3 2004
时光说笑
时光说笑 2021-01-13 04:18

This question is just out of curiosity. I want to know how jquery\'s .click() works behind the scenes.

For instance if I create a button:



        
3条回答
  •  长发绾君心
    2021-01-13 04:27

    Uses the DOM event model, which is also what happens when you add the onClick(). so basically it registers a listener for the button to fire off the click event and then performs the code you told it to.

提交回复
热议问题