Home >Web Front-end >JS Tutorial >A brief analysis of the readonly and enabled attributes of js setting controls_javascript skills

A brief analysis of the readonly and enabled attributes of js setting controls_javascript skills

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

How to set the readonly and enabled attributes of the control using js?

I tried setting it like this but it didn’t work. Text1 is

text1. readonly=true;

and

text1.enabled=true;

neither work, why???

Answer:

disabled=flase; //lowercase
readOnly=true; //uppercase

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