:read-write¶
Псевдокласс :read-write
применяется к полям формы, доступных для изменения. Псевдокласс :read-write
является противоположным по своему действию :read-only
, который применяется к полям с атрибутом readonly
(только для чтения).
Псевдоклассы
- :active
- :any-link
- :blank
- :checked
- :current()
- :default
- :defined
- :dir()
- :disabled
- :empty
- :enabled
- :first
- :first-child
- :first-of-type
- :focus
- :focus-visible
- :focus-within
- :fullscreen
- :future
- :has()
- :host
- :host()
- :host-context()
- :hover
- :indeterminate
- :in-range
- :invalid
- :is()
- :lang()
- :last-child
- :last-of-type
- :left
- :link
- :local-link
- :not()
- :nth-child()
- :nth-col()
- :nth-last-child()
- :nth-last-col()
- :nth-last-of-type()
- :nth-of-type()
- :only-child
- :only-of-type
- :optional
- :out-of-range
- :past
- :placeholder-shown
- :read-only
- :read-write
- :required
- :right
- :root
- :scope
- :target
- :target-within
- :user-invalid
- :valid
- :visited
- :where()
Синтаксис¶
input:-moz-read-write {
background: #eee;
}
input:read-write {
background: #eee;
}
Спецификации¶
Пример¶
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>:read-write</title>
<style>
input:read-write {
border: 1px solid green;
}
</style>
</head>
<body>
<form action="handler.php">
<p>
<input
type="text"
size="40"
value="Введенный текст не может изменяться"
readonly
/>
</p>
<p>
<input
type="text"
size="40"
value="Этот текст может изменяться"
/>
</p>
<p>
<input type="submit" value="Отправить" />
</p>
</form>
</body>
</html>
См. также¶
Ссылки¶
- Псевдо-класс :read-write MDN (рус.)