The ReadOnly attribute in JS is rather strange. Create an object directly and assign the readonly attribute to the object. You cannot use the following method like in HTML:
var x=document.createElement("input");
x.type="text";
x.value="ttttt ";
x.id="xy";
x.readonly="readonly";
The object created in this way is not read-only. The correct way to write it is:
var x=document.createElement( "input");
x.type="text";
x.value="ttttt";
x.id="xy";
x.readOnly=true;
You should pay attention to this when writing JS.
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