JSFiddle - React, Tailwind, and code Playground

by Alex Baumgertner

HTML

<label class="input input_required">
    <div class="input__text">Имя:</div>
    <input class="input__control" type="checkbox" name="name" value="" placeholder="Введите ваше имя" />
</label>

CSS

.input_required .input__text:after {
    content:'*'
}

JavaScript

var inputTest = document.querySelector('.input');

inputTest.addEventListener('change', function (e) {
    alert(e);
});