Đối tượng công cụ đo DOM HTML
Đối tượng đồng hồ
Đối tượng Meter đại diện cho một phần tử HTML <meter>.
Lưu ý: Phần tử <meter> không được hỗ trợ trong Internet Explorer / Edge hoặc Safari 5 (và các phiên bản trước đó).
Truy cập một đối tượng mét
Bạn có thể truy cập phần tử <meter> bằng cách sử dụng getElementById ():
Thí dụ
var x = document.getElementById("myMeter");
Tạo đối tượng đồng hồ
Bạn có thể tạo một phần tử <meter> bằng cách sử dụng phương thức document.createElement ():
Thí dụ
var x = document.createElement("METER");
Thuộc tính đối tượng mét
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 |
Thuộc tính và sự kiện tiêu chuẩn
Đối tượng Meter cũng hỗ trợ các thuộc tính và sự kiện tiêu chuẩn .
Các trang liên quan
Tham chiếu HTML: Thẻ <meter> HTML