สไตล์คาเร็ตคุณสมบัติ สี
ตัวอย่าง
กำหนดสีของเคอร์เซอร์เป็นสีแดงภายในช่องใส่:
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: คุณสมบัติคาเร็ตสี
❮ สไตล์วัตถุ