JSFiddle - React, Tailwind, and code Playground

HTML

<form class="my-form">
    <input type="text" class="my-input">
    <button type="submit">Submit</button>
</form>

JavaScript

$(document).on('input', '.my-input', function () {
    $(this).closest('form').addClass('changed');
});

$(document).on('submit', '.my-form', function (e) {
    if ($(this).hasClass('changed')) {
        var allowSubmit = window.confirm("You have set a unique threshold for one or more states below. Are you sure you want to reset them all?")
        if (!allowSubmit) 
            e.preventDefault()
    }
    $(this).removeClass('changed');
});