Alternative answer not taken into account


#1

Hello,

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


#2

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.


#3

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