スタイルcaretColorプロパティ
例
入力フィールド内でカーソルの色を赤に設定します。
document.getElementById("input1").style.caretColor = "red";
定義と使用法
caretColorプロパティは、入力、テキスト領域、または編集可能な要素のカーソル(キャレット)の色を指定します。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
caretColor | 57.0 | 79.0 | 53.0 | 11.1 | 44.0 |
構文
caretColorプロパティを返します。
object.style.caretColor
caretColorプロパティを設定します。
object.style.caretColor = "auto|color|initial|inherit"
プロパティ値
Value | Description |
---|---|
auto | Default. Browsers uses the currentColor for the caret |
color | Specifies a color to use for the caret. All legal color values can be used (rgb, hex, named-color, etc). For more information on legal values, read our CSS Colors Tutorial |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | 自動 |
---|---|
戻り値: | 要素のキャレットカラーを表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSリファレンス:caret-colorプロパティ
❮スタイルオブジェクト