JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

<form><input type="text" id="i"></form>
<br />
Type a text and press enter.

Browsers will log both events.

IE8 won't log either.
<br />
<textarea id="console" rows="20" cols="50"></textarea>

JavaScript

var log = function(s){
    var c = $('#console');
    c.html(c.html()+"\r\n"+s);
};

$('#i').change(function(){
    log("change using bind");
});
$('#i').submit(function(){
    log("submit using bind");
});
$(document).delegate('#i', 'change', function(){
    log("change using delegate");
});
$(document).delegate('#i', 'keydown', function(){
    log("keydown using delegate");
});
$(document).delegate('form', "submit", function(){
    log("submit using delegate");
    return false;
});