JSFiddle - React, Tailwind, and code Playground
by neerajdotname
HTML
<div>
<label for="name">Name</label>
<input class="required" type="text" name="name" id="name" />
<span>*</span>
</div>
<div>
<label for="email">Email</label>
<input type="text" name="email" id="email" />
</div>
CSS
div { margin: 10px;}
.gender label { margin-right: 10px;}
.highlight { background: yellow;}
JavaScript
//
// make the asterik of color red
//
$('input.required').parent().find('span').css({color: 'red'});