JSFiddle - React, Tailwind, and code Playground
by Leandro Barbosa
HTML
<form>
<input id="id1" class="id1" value='#id1'>
</form>
CSS
input {
background-color: #000;
color: #fff;
padding: 12px 20px;
}
JavaScript
$('form .id1').on('click', function() {
$(this).css('background', 'red');
$(this).val('red');
});
$('form .id1').on('focus', function() {
$(this).css('margin-top', 20);
});
$('.id1').on('click', function() {
$(this).css('background', 'blue');
$(this).val('blue');
});
$('.id1').on('focus', function() {
$(this).css('margin-left', 20);
});