Hi,

I've come across some behaviour that seems a bit odd to me, not sure
if its by design or a bug. I've been trying to fire the click event of
a button with the following:

$('#mybtn').click();

However this causes the click event to fire twice, the result is the
form being submitted twice. I was able to fix it by using instead:

$('#mybtn')[0].click();

Which only fires the event once. This only happens with buttons
(type="button|submit|reset") not any other element I've tried like
hyperlinks. I haven't tried it with a collection of buttons rather
than one selector, I guess that would be the next step. So, is it
supposed to do this and if so why?

Cheers,
Rory Fitzpatrick

Reply via email to