maxLength

This property is used to set the maximum text length of the given field. The number is any positive integer which suits your requirements.

syntax:

document.formID.elementID.maxLength = "value"

This Property is used to access attributes of the following:

password
text