Input Search maxLength Attribute
Definition and Usage
maxLength
Set or return the value of the maxlength attribute of the search field.
The HTML maxLength attribute specifies the maximum number of characters allowed in the search field, with a default value of 524288.
Tip:To set or return the width of the search field (in characters), use size attribute。
See also:
HTML Reference Manual:HTML <input> maxlength లక్షణం
Example
Example 1
Get the maximum number of characters allowed in a specific search field:
var x = document.getElementById("mySearch").maxLength;
Example 2
Change the maximum number of characters allowed in the search field:
document.getElementById("mySearch").maxLength = "8";
Syntax
Return maxLength property:
searchObject.maxLength
set maxLength property:
searchObject.maxLength = number
లక్షణం విలువ
విలువ | వివరణ |
---|---|
number | శోధన క్షేత్రంలో అనుమతించే గరిష్ట అక్షరాల సంఖ్యను నిర్ధారించు. అప్రమేయ విలువ 524288. |
సాంకేతిక వివరాలు
తిరిగివచ్చే విలువ | సంఖ్య, దానికి అనుమతించే గరిష్ట అక్షరాల సంఖ్యను ప్రతినిధీకరిస్తుంది. |
---|
బ్రౌజర్ మద్దతు
చ్రోమ్ | ఎడ్జ్ | ఫైర్ఫాక్స్ | సఫారీ | ఓపెరా |
---|---|---|---|---|
చ్రోమ్ | ఎడ్జ్ | ఫైర్ఫాక్స్ | సఫారీ | ఓపెరా |
మద్దతు | మద్దతు | మద్దతు | మద్దతు | మద్దతు |