วัตถุHTML DOM Meter
วัตถุมิเตอร์
วัตถุ Meter แสดงถึงองค์ประกอบ HTML <meter>
หมายเหตุ:องค์ประกอบ <meter> ไม่รองรับใน Internet Explorer / Edge หรือ Safari 5 (และเวอร์ชันก่อนหน้า)
เข้าถึงวัตถุมิเตอร์
คุณสามารถเข้าถึงองค์ประกอบ <meter> โดยใช้ getElementById():
ตัวอย่าง
var x = document.getElementById("myMeter");
สร้างวัตถุมิเตอร์
คุณสามารถสร้าง <meter> องค์ประกอบโดยใช้ document.createElement() วิธีการ:
ตัวอย่าง
var x = document.createElement("METER");
คุณสมบัติของวัตถุมิเตอร์
Property | Description |
---|---|
high | Sets or returns the value of the high attribute in a gauge |
labels | Returns a list of <label> elements that are labels for the gauge |
low | Sets or returns the value of the low attribute in a gauge |
max | Sets or returns the value of the max attribute in a gauge |
min | Sets or returns the value of the min attribute in a gauge |
optimum | Sets or returns the value of the optimum attribute in a gauge |
value | Sets or returns the value of the value attribute in a gauge |
คุณสมบัติและเหตุการณ์มาตรฐาน
ออบเจ็กต์ Meter ยังสนับสนุนคุณสมบัติและเหตุการณ์ มาตรฐาน อีกด้วย
หน้าที่เกี่ยวข้อง
การอ้างอิง HTML: แท็ก HTML <meter>