编辑下面的代码:【加编码】
<html> <head> <style> input:read-only { background-color: yellow; } </style> </head> <body> <h3> :read-only 选择器实例演示。</h3> <p>普通的input元素:<br><input value="hello"></p> <p>只读的input元素:<br><input readonly value="hello"></p> <p> :read-write 选择器选取没有设置 "readonly" 属性的元素。</p> <p> :readonly 择器选取设置 "readonly" 属性的元素。</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂