JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="txtInput"></textarea>
<button id="validate">Validate</button>

JavaScript

document.getElementById('validate').onclick = function () {
    var id = document.getElementById('txtInput');
    var text = id.value.toLowerCase();
    if (text.indexOf('<?') > -1 || text.indexOf('script') > -1){
        alert('hacking attempt');
    }
}