Home Ask Login Register

Developers Planet

Your answer is one click away!

Slayner February 2016

Javascript maxLength on tag

I have found on the internet that the maxlenght for an input is :

524288 characters

I can't find any information regarding textArea.

I need to passe a var that can be up to 1 500 000 characters, so I try to find something similar to an input text or a textArea or label that can be use for that.

So my question is, is there a tag capable of such a huge capacity (If you can tell me the max lenght capacity of tag element it could be nice too) ?


gurvinder372 February 2016

textarea has a maxlength attribute

<textarea maxlength="number">

spec doesn't put any limit on the limit of this value

but there is a max limit to the integer itself

So, you can put Number.MAX_SAFE_INTEGER characters in the textarea, which is around

 Math.pow(2, 53) - 1     // 9007199254740991

Rahul Tripathi February 2016

You probably understood it. The link clearly said that it is the default value. There is no upper limit to the maxlength. You can store unlimited characters using the maxlength.

Post Status

Asked in February 2016
Viewed 3,731 times
Voted 11
Answered 2 times


Leave an answer

Quote of the day: live life