Difference between HTML readonly and enabled

Time:2021-12-21

The textbox of readonly attribute will be displayed as such a mark on the client: < input readonly = “readonly” >

The textbox of enabled attribute will be displayed as such a mark on the client: < input disabled = “disabled” >

The HTML server control uses a class derived from the htmlcontrol base class (full class name system. Web. UI. Htmlcontrols), which has only the disabled property

According to W3C specifications: http://www.w3.org/TR/REC-html40/interact/forms.html#h -17.12

Input set to disabled will have the following restrictions:

<1> Can accept the focus < 2 > will be skipped when using the tab key < 3 > may not be successful. The input set to readonly will have the following restrictions:

<1> It can accept the focus but cannot be modified < 2 > use the tab key to navigate < 3 > may be successful. Only successful form elements are valid data, that is, submission can be made The disabled and readonly text input boxes can only modify the value attribute through the script

Recommended Today

Example of realizing canvas shadow effect with HTML5

Realize canvas shadow effect in HTML5 Copy code The code is as follows: <!DOCTYPE html><html><head><meta http-equiv=”X-UA-Compatible” content=”chrome=IE8″><meta http-equiv=”Content-type” content=”text/html;charset=UTF-8″><title>Canvas Clip Demo</title><link href=”default.css” rel=”stylesheet” /> <script> var ctx = null; // global variable 2d context var imageTexture = null; window.onload = function() { var canvas = document.getElementById(“text_canvas”); console.log(canvas.parentNode.clientWidth); canvas.width = canvas.parentNode.clientWidth; canvas.height = canvas.parentNode.clientHeight; if (!canvas.getContext) […]