js实时提示文本框还能输入的字数
- ??
- function?countChar(textareaName,spanName){??
- ????????var?val?=?document.getElementById(textareaName).value;??
- ?????????if(300-val.length?<=0)?{??
- ????????????document.getElementById(spanName).innerHTML?=?0;??
- ????????????document.getElementById(textareaName).value?=?val.substring(0,300);??
- ?????????}else{??