เคาน์เตอร์ สไตล์Increment Property
ตัวอย่าง
เปลี่ยนคุณสมบัติ counterIncrement:
document.getElementById("myH1").style.counterIncrement = "subsection";
ความหมายและการใช้งาน
คุณสมบัติ counterIncrement เพิ่มค่าตัวนับตั้งแต่หนึ่งค่าขึ้นไป
คุณสมบัติ counterIncrement มักจะใช้ร่วมกับคุณสมบัติ counterReset และคุณสมบัติเนื้อหา
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
counterIncrement | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ counterIncrement:
object.style.counterIncrement
ตั้งค่าคุณสมบัติ counterIncrement:
object.style.counterIncrement = "none|id|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | Default value. No counters will be incremented |
id number | The id defines which counter that should be incremented. The number sets how much the counter will increment on each occurrence of the selector. The default increment is 1. 0 or negative values, are allowed. If the id refers to a counter that has not been initialized by counter-reset, the default initial value is 0 |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | ไม่มี |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงคุณสมบัติการเพิ่มขึ้นเคาน์เตอร์ขององค์ประกอบ |
เวอร์ชัน CSS | CSS2 |
❮ สไตล์วัตถุ