Home >Web Front-end >JS Tutorial >How to set the value of readOnly in JS_javascript skills

How to set the value of readOnly in JS_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:07:171309browse

In web pages, we sometimes need to control the "input status" of the text input box. Some key attributes cannot be modified. At this time, we need to set the readonly attribute of the text input box to False. In the web page, we can use

But in JS, we cannot use txt_name.readonly="readonly" to set this attribute. Since JS is case-sensitive, when calling this attribute, we must use txt_name.readOnly=true to set it. .

Of course, the web page text box also has an attribute that can control its status, disabled. This attribute also restricts users from modifying the content of the text box. However, after this attribute is set to "disabled", the C# background code cannot obtain this control. content.

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