JSFiddle - React, Tailwind, and code Playground
HTML
<!-- code for input -->
<div class="form-group complete">
<label>label for text input</label>
<input type="text"><span class="bigThing">This is an error message</span>
</div>
<!-- code for dropdown -->
<div class="form-group complete">
<label>label for select input</label>
<div class="custom-selectbox custom-selectbox-form">
<select name="sth" required>
<option>a</option>
<option>b</option>
<option>c</option>
<option>d</option>
</select> <span class="selectedValue"> </span>
<span class="is-visually-hidden">select to open the list</span>
</div> <span class="error-message">This is an error message</span>
</div>
CSS
.complete input[type="text"] + :before {
content:'OK';
font-size: 200%;
display: block;
}
.bigThing {
color: purple;
display: none;
}
.complete input[type="text"] {
color: red;
display: inline-block;
}