x
1
2
<html>
3
<head>
4
<style>
5
input:read-only {
6
background-color: yellow;
7
}
8
</style>
9
</head>
10
<body>
11
12
<h3>A demonstration of the :read-only selector.</h3>
13
14
<p>A normal input element:<br><input value="hello"></p>
15
16
<p>A readonly input element:<br><input readonly value="hello"></p>
17
18
<p>The :read-only selector selects form elements with a "readonly" attribute.</p>
19
20
</body>
21
</html>
A demonstration of the :read-only selector.
A normal input element:
A readonly input element:
The :read-only selector selects form elements with a "readonly" attribute.