限制textarea文本框字数的两种方法 //不能直接在css样式表中添加maxlength //在js中引入id为msg的textarea。 msg.setAttribute(“maxlength”,140);