keydown and tabindex

Shows that elements must be able to receive focus to be able to handle keydown events.

by lddubeau

HTML

<p contenteditable="true">This is <b tabindex="0">a test</b> with more <b>text</b>.</p>

JavaScript

$(function () {
    $("b").on("keydown", function () {
        $("p").append("*key*");
    });
});