Thuộc tính kiểu dấu mũMàu
Ví dụ
Đặt màu của con trỏ thành màu đỏ bên trong trường nhập:
document.getElementById("input1").style.caretColor = "red";
Hãy tự mình thử »Sự miêu tả
Thuộc tính caretColor chỉ định màu của con trỏ (dấu mũ) trong đầu vào, vùng văn bản hoặc bất kỳ phần tử nào có thể chỉnh sửa được.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
caretColor | 57.0 | 79.0 | 53.0 | 11.1 | 44.0 |
Cú pháp
Trả về thuộc tính caretColor:
object .style.caretColor
Đặt thuộc tính caretColor:
object .style.caretColor = "auto| color |initial|inherit"
Giá trị tài sản
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 |
Chi tiết kỹ thuật
Giá trị mặc định: | tự động |
---|---|
Giá trị trả về: | Một Chuỗi, biểu thị màu dấu mũ của một phần tử |
Phiên bản CSS | CSS3 |
Trang liên quan
Tham chiếu CSS: thuộc tính dấu mũ