JSFiddle - React, Tailwind, and code Playground
by Erik Woods
HTML
<input placeholder="First" data-qdc-calc-input type="text" />
<input placeholder="Last" data-qdc-calc-input type="text" />
<input placeholder="ZIP" data-qdc-calc-input data-qdc-lf-zipcode type="text" />
<input placeholder="Other" data-qdc-calc-input type="text" />
CSS
input {
display: block;
}
JavaScript
let textBoxes = $('[data-qdc-calc-input]');
$(document).ready(function() {
textBoxes.on('change', function() {
if (!$(this).is('[data-qdc-lf-zipcode]')) {
$(this).val('condition was met: field is not for ZIP');
}
});
});