Input Search maxLength Attribute

Definition and Usage

maxLength Set or return the value of the maxLength property of the search field.

The HTML maxLength property 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;

Try it yourself

Example 2

Change the maximum number of characters allowed in the search field:

document.getElementById("mySearch").maxLength = "8";

Try it yourself

Syntax

Return maxLength property:

searchObject.maxLength

set maxLength property:

searchObject.maxLength = number

প্রতিভূত মান

মান বর্ণনা
number সন্ধান ক্ষেত্রে অনুমদিত সর্বমোট অক্ষর সংখ্যা নির্ধারণ করুক।ডিফল্ট মান 524288

প্রযুক্তিগত বিবরণ

ফলাফল: সংখ্যা, যা সংকেত করে যে সর্বমোট অক্ষর সংখ্যা সন্ধান ক্ষেত্রে অনুমদিত

ব্রাউজার সমর্থন

চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
সমর্থন সমর্থন সমর্থন সমর্থন সমর্থন