Alternative answer not taken into account


I’ve been learning jQuery for a few weeks, and I’ve always have been using .click(function(){}) (instead of .on(‘click’, ’ ') => {}), which does the same thing.

Problem is I cannot go further without using exactly what the exercise want. It would be nice if both were valid anwsers so users aren’t obligated to use practices they don’t like.

Why would I do this training if I already know what to do? Well I burned steps and I need to get some more basis and a reminder aswell.

Thanks, hopefully it helps future users

1 Like

Nice point.

They don’t actually do the same thing, however. Elements that are dynamically added by your script will not be bound with .click but will be bound with .on you can read a little more here.

In the vast majority of cases though you are right they are the same.

1 Like

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