The rendering is as follows:
JQUERY code:
var text=$(".release textarea").val();//Get the value of the input box
var counter=text.length; //Get the value of the input box
$(" #numtj em").text(500-counter);
$(document).keyup(function() {
var text=$(".release textarea").val();
var counter=text.length;
$("#numtj em").text(500-counter);
if(counter>500){ //If the number of words is greater than 500
$(".public" ).addClass("public01").attr("disabled","true") //Publish button is disabled
}
else{
$(".public").removeClass("public01") .removeAttr("disabled") //Publish button enabled
}
});
Word count style:
#numtj em {
font-weight: 700;
font-size: 22px;
font- style: italic;
font-family: Constantia, Georgia;
color:#C00;
}