function checkMaxLength(obj,max){
if(obj.value.length > max)
{
alert("输入内容长度超出限制!");
obj.value = obj.value.substring(0,max);
}
}
<textarea onpropertychange="checkMaxLength(this,200)" oninput="checkMaxLength(this,200)" ></textarea>