JSFiddle - React, Tailwind, and code Playground

HTML

<form>

<textarea id='message'></textarea>
<input type='submit' name='submit' id='add' class='submit_disabled i1' value='<% $_.Reply %>' disabled/>

<a href='aaaa'>aaaa</a>
    
</form>

CSS

input[type="submit"]{background-image:url(i/set1.png);background-repeat:no-repeat;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, .1);cursor:pointer;display:inline-block;text-align:center;text-decoration:none;vertical-align:top;white-space:nowrap;font-weight:bold;line-height:13px;}
.submit_disabled{opacity:0.5}

JavaScript

function setConfirmUnload(on){window.onbeforeunload = (on) ? unloadMessage : null;}function unloadMessage(){return 'PREVENT_loss_data';}$(document).ready(function(){$('textarea').bind("change",function(){setConfirmUnload(true);});$('form').submit(function(){setConfirmUnload(false);});});


jQuery(function ($) {
    $('#message').bind("focus blur change keyup", function(){
        var val = this.value;
        $("input[type='submit']").prop("disabled", !this.value || this.value === "placeholder");
    }).change();
});