< script > function TextCounter(field, maxLimit) { if (field.value.length > maxLimit) field.value = field.value.substring( 0 , maxLimit); else document.Form1.remLen.value = maxLimit - field.value.length; } </ script > < textarea name = " content " cols = " 73 " rows = " 5 " onPropertyChange = " TextCounter(Form1.content, 1000) " ></ textarea > < input name = " remLen " value = " 1000 " readonly type = " text " size = " 4 " maxlength = " 3 " style = " BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; COLOR: red; BORDER-BOTTOM: 0px; BACKGROUND-COLOR: #eaffe0 " > 转载于:https://www.cnblogs.com/xiaodi/archive/2005/03/17/120155.html