JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

<input type="text" id="one" class="field" />
<input type="text" id="two" class="field" />
<div id="log"></div>

CSS

#log {
     border: 1px solid red;
     width: 80%;
     height: 100px;
     overflow: auto;
 }

JavaScript

// #6705 (IE8)

var counter = 0;

var fields = $('.field');
fields.focus (function () {
    $('#log').prepend ([
        counter++,
        ") field '",
        $(this).attr ('id'),
        "' focused<br/>",
    ].join (''));
});

fields.focus ();