jQuery .trigger('focus') bug

by ian_smithz

HTML

<ul>
  <li>.trigger('custom.foo') will only run the "custom.foo" handler.</li>
  <li>.trigger('click.foo') resets the form, and only runs the "click.foo" handler.</li>
  <li>.trigger('focus.foo') focusses the input and runs all "focus" handlers.</li>
</ul>

<form>
  <input class="field" />
  <input class="reset" type="reset" />
</form>

<a href="#" class="focus-foo">focus.foo</a>
<a href="#" class="click-foo">click.foo</a>
<a href="#" class="custom-foo">custom.foo</a>

JavaScript

$('.focus-foo').click(function() {
  $('.field').trigger("focus");
  //$(this).fadeOut('slow'):
});