Test Case Boilerplate

Fork this way...

by stepanbujnak

HTML

<p>
    <form>
        <input id="focus" type="text" name="" value="" />
        <a href="#">Focus!</a>
    </form>
</p>
<p>
    Focused <strong id="count">0</strong> times.
</p>

JavaScript

$('a').click(function () {
    $('#focus').focus();
});

$('#focus').focus(function () {
    var text = parseInt($('#count').text());
    text++;
    $('#count').text(text);
});