Thuộc tính kiểu caretColor
Thí dụ
Đặt màu của con trỏ thành màu đỏ bên trong trường nhập liệu:
document.getElementById("input1").style.caretColor = "red";
Định nghĩa và Cách sử dụng
Thuộc tính caretColor chỉ định màu của con trỏ (dấu mũ) trong các đầ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.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
caretColor | 57.0 | 79.0 | 53.0 | 11.1 | 44.0 |
Cú pháp
Trả lại 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ả lại: | Một chuỗi, đại diện cho màu dấu mũ của một phần tử |
Phiên bản CSS | CSS3 |
Các trang liên quan
Tham chiếu CSS: thuộc tính caret-color
❮ Đối tượng phong cách