1024programmer Java Summary of several methods for setting text input boxes in form elements to be non-editable_javascript skills

Summary of several methods for setting text input boxes in form elements to be non-editable_javascript skills

Code:

The code is as follows:




The input box cannot gain focus and cannot be edited
The form can obtain the value.
Can be copied.
It’s quite strange. You’ve selected it, but you haven’t gotten the focus yet?


2,readonly


Code:



The input box is read-only. Cannot be edited
The same form can get the value.
Can also be copied.


3,disabled


Code:

The code is as follows:




The input box is gray and cannot be edited
It can be used JS changes or gets its value, but does not submit the value when submitted.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/631990

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索