JSFiddle - React, Tailwind, and code Playground
by ArsenyDP
HTML
Передай фокус в это окно и печатай текст:
<div class="text">
</div>
CSS
.text span:nth-child(2n) {
color: red;
}
JavaScript
$(function(){
let parent = $('.text');
$(document).keypress(function(e){
parent.append(`<span>${String.fromCharCode(e.which)}</span>`);
})
});