Sergi Sergi - 1 year ago 77
HTML Question

Fixed height text input field, text on top

I have a text input field with a fixed height, I want the box to look big because of the considerable amount of text that has to be typed in it. The problem is, when the height is set and the user clicks in the box, the text starts right at the center of the box, I would like the text to start on top. My code:




<input type="text" id="mainText" value="Your text">
<button> Submit Text </button>





#mainText {width:400px; height:300px;}

Answer Source

Try using an input type called textarea. It's better for large amounts of text. See

Example usage:

<textarea id="mainText" name="mainText">Your text</textarea>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download