Doubt with the click() event method


Hi, I have a doubt about what you explain about the .click() method. In the 4 task of the exercise you mention the following problem with .click():

"The .click() method won't work on dynamically added HTML elements. Instead, we need to use the .on() method."

Therefore my question is:

Would that problem also affect to .hover(), .dbclick(), .focus() and the rest of the event methods?

If so, I guess it'd be advisable to also use the .on() method with them, isn't it?

Thank you!


Understanding how this works under the hood in JS would be the best way to know for certain

But i suspect you are right about hover, dbclick and focus as well. Simply enough to test, right?

I have a basic understanding of that, i would argue that hover and so on will not work for dynamically added content


Thank you! I will check it and do a little research!


doing research is a very good idea :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.