JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="txtJobDesc" row="10"></textarea>
<input type="button" value="submit" onclick="CheckContent();"/>
JavaScript
var RegForRestrictHtmlTags2 = /<(.|\n)*?>/g;
function CheckContent(){
$('#txtJobDesc').val("AAAAAAAA<fff>AAAAAA");
console.log(RegForRestrictHtmlTags2.lastIndex);
console.log(RegForRestrictHtmlTags2.test($('#txtJobDesc').val()));
}
//when you click on "submit" button first time you get "true" and second time you get "false" for same content.