The code copy is as follows:
<input name="title" type="text" size="50" value="{$p.title}" maxlength="15" onkeyup="javascript:setShowLength(this, 15, 'cost_tpl _title_length');"> <span id="cost_tpl_title_length">You can also enter 15 words</span>
js:
The code copy is as follows:
function setShowLength(obj, maxlength, id)
{
var rem = maxlength - obj.value.length;
var wid = id;
if (rem < 0){
rem = 0;
}
document.getElementById(wid).innerHTML = "You can also enter" + rem + "word count";
}