JSFiddle - React, Tailwind, and code Playground

HTML

<input id="one" type="text">

<a href="google.com" class="button">OK</a>

CSS

.disabled {
    color : gray;
    cursor : default;
}

JavaScript

$(function () {
    
    $(".button").addClass('disabled');
    
    $("#one").keyup(function () {

        var one = $("#one").val();
            
        if (one) {
            $(".button").removeClass('disabled');
        } else {
            $(".button").addClass('disabled');
        }
    });

    $('.button').click(function (e) {
        if ($(this).hasClass('enabled')) return false;
    });
});