style caretColor- Eigenschaft
Beispiel
Setzen Sie die Farbe des Cursors innerhalb eines Eingabefeldes auf rot:
document.getElementById("input1").style.caretColor = "red";
Definition und Verwendung
Die Eigenschaft caretColor gibt die Farbe des Cursors (Caret) in Eingaben, Textbereichen oder anderen bearbeitbaren Elementen an.
Browser-Unterstützung
Property | |||||
---|---|---|---|---|---|
caretColor | 57.0 | 79.0 | 53.0 | 11.1 | 44.0 |
Syntax
Geben Sie die Eigenschaft caretColor zurück:
object.style.caretColor
Legen Sie die caretColor-Eigenschaft fest:
object.style.caretColor = "auto|color|initial|inherit"
Eigenschaftswerte
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 |
Technische Details
Standardwert: | Auto |
---|---|
Rückgabewert: | Ein String, der die Caret-Farbe eines Elements darstellt |
CSS-Version | CSS3 |
Verwandte Seiten
CSS-Referenz: caret-color-Eigenschaft
❮ Style-Objekt