First, obtain the value of the input box and then obtain the value of the input box. If the number of words is greater than 500 and the release button is disabled, enable the release button. For more information, see the following:
JQUERY code:
The Code is as follows:
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 exceeds 500
$ (". Public"). addClass ("public01"). attr ("disabled", "true") // disable the publish button
}
Else {
$ (". Public"). removeClass ("public01"). removeAttr ("disabled") // The publish button is enabled.
}
});
Word Style:
The Code is as follows:
# Numtj em {
Font-weight: 700;
Font-size: 22px;
Font-style: italic;
Font-family: Constantia, Georgia;
Color: # C00;
}