Use of textarea in html and a common problem solution

Source: Internet
Author: User

The textarea tag is an html Tag that we often use. It is mainly used to achieve line breaks and other effects when a long text is input. Next we will reference a basic usage of textarea tag, which indicates that the textarea tag of multiple input fields in an HTML form appears in pairs, starting with <textarea> and ending with </textarea>: common -- General attribute cols -- number of columns in the multi-row input field rows -- number of rows in the multi-row input field accesskey -- the access method of the form shortcut key is disabled -- the input field cannot obtain the focus and cannot be selected, it is displayed in gray, and the form does not have any function. readonly -- the input field can be selected, but tabindex cannot be modified. The following is an example of how to use the "tab" key to traverse the order: Html code: <form id = "textareaDem" action = "#" method = "post"> <textarea cols = "50" rows = "10" id = "contactus" name = "contactus"> tag </textarea> </Form> you can copy the code to a local machine for testing. The problem arises. If the two <textarea> </textarea> are not on one row, for example, the Code www.2cto.com <form id = "textareaDemo" action = "#" method = "post"> <textarea> with different write effects on different lines of the textarea tag. </textarea> </form>: the code at the beginning is displayed on the left alignment, and the next one is displayed in the center. Therefore, when using textarea, you must note that the text in the textarea label is relative to that of textarea. textarea is equivalent to providing an editing area that begins with textarea, that is, what you see is what you get. As long as the two labels are not in one line, the blank space before </textarea> will also be recognized as blank text, you will find that your mouse editing pointer does not flash at the beginning or next to the text. So we need to use this label well and know where to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.