
1 通过js实现-onfocus=”this.blur()”
<input type=”text” onfocus=”this.blur()” value=”rainshadow” />
输入框无法获得焦点,不能编辑表单可以获得值,可以复制,蛮奇怪的,都选住了,还没有获得焦点?
2 readonly
<input readonly=”readonly” type=”text” value=”rainshadow” />
输入框只读。不能编辑,同样表单可以获得值,也可以复制。
3 disabled
<input disabled=”disabled” type=”text” value=”rainshadow” />
输入框灰色,不能编辑,可以用JS改变或获得其值,但提交时并不提交该值。
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com
You can find more information in our Cookie Policy and Cookie Policy.