HTML input read-only

Source: Internet
Author: User
HTML input read-only

There are two ways to achieve the read-only effect of input: Disabled and readonly.

Naturally, the two effects are read-only and cannot be edited, but they are quite different.

Disabled indicates that the input is invalid and its value is not passed to anyProgramSuch as ASP and PHP.
Readonly is not editable and does not affect the value transfer.

Disabled usage:

<Input type = "text" name = "username" value = "James" disabled>


Readonly usage:

<Input type = "text" name = "partnumber" value = "1500" readonly>

Note:

1. The performance of IE is the same, but the whereabouts of FF are unknown. readonly can aggregate, but disabled cannot, and the default background color is displayed.

Share several CSS style tips:

######################################## #########################

1. Remove the underline and blue font of The Link. When the mouse moves to the link, the underline Of the link is displayed and the font turns red.

A: link {
Color: #666666; text-Decoration: None
}
A: hover {
Color: # ff0000; text-Decoration: underline
}

2. If an image is added to the link, you will find that the image has a blue border, which is very ugly. It is very easy to remove the blue border of the image in the link.

Border = "0"

Example: <a href = "url"> </a>

You can...

####################################### 3

20121207 JavaScript problems:

When JS is used for addition operations, the addition operation is not performed using the plus sign (+). Instead, the addition operation is converted into a string connection and the numbers are spliced into a numeric string. How can this problem be solved?

The solution is simple: Use the eval () function where + is used, for example:

Function add (a, B ){

Return eval (A) + eval (B );

}

This solves this 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.