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;
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn