+ 5
What is difference between "size" and "maxlength" attribute of <input> element....?
Are they used for same purpose...
3 Answers
+ 13
size - sets the width of the input based on characters. For example, I'll set the size to 30, the width of an input will be adjusted where it can fit 30 characters in a textbox but you can still type texts above 30 characters
maxlength - sets the maximum characters inside an input. For example, I'll set the maxlength to 10, you can only type 10 characters and would prevent you to type if it reached 10 characters.
+ 4
Satyendra Singh Yes, it reflects the width size of the textbox.
0
Sleepy Koala mean to say size is for defining the width of rectangular box...?