Home  >  Article  >  Web Front-end  >  What is the standard way of writing readonly for INPUT tag in HTML? _html/css_WEB-ITnose

What is the standard way of writing readonly for INPUT tag in HTML? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:14:471511browse

This post was last edited by frontlon on 2012-09-10 13:57:30

After testing:





will all take effect.


and even



can all take effect.



This seems to be effective as long as readonly exists.

But this way of writing is in





is not a standard way of writing, and the editor prompts a syntax error.



What is the correct way to write it in the W3C standard?

Reply to the discussion (solution)

Search more and try more and you will know.

readonly="true" or readonly="false" This is to set the read-only nature of the tag

XHTML is different from html. The commonly used writing method is readonly="true" or readonly

xhtml is more rigorous, the standard writing method is readonly="readonly" Refer to W3C

disabled="true" The text will turn gray and cannot be edited

readOnly="true" The text will not change color , also cannot be edited

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn