HTML max Attribute
ความหมายและการใช้งาน
แอตทริบิวต์max
ระบุค่าสูงสุดขององค์ประกอบ
เมื่อใช้โดย<progress>
องค์ประกอบ
max
คุณลักษณะจะระบุจำนวนงานที่ต้องการทั้งหมด
นำไปใช้กับ
สามารถใช้ แอตทริบิวต์max
กับองค์ประกอบต่อไปนี้:
องค์ประกอบ | คุณลักษณะ |
---|---|
<input> | max |
<เมตร> | max |
<ความคืบหน้า> | max |
ตัวอย่าง
ตัวอย่างอินพุต
การใช้แอตทริบิวต์ min และ max:
<form action="/action_page.php">
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
<input type="submit">
</form>
ตัวอย่างมิเตอร์
เกจที่มีค่าปัจจุบันและส่วนต่ำสุด สูงสุด สูงและต่ำ:
<meter min="0" low="40" high="90" max="100" value="95"></meter>
ตัวอย่างความคืบหน้า
กำลังดาวน์โหลด:
<progress value="22" max="100"></progress>
รองรับเบราว์เซอร์
แอตทริบิวต์max
มีการสนับสนุนเบราว์เซอร์ต่อไปนี้สำหรับแต่ละองค์ประกอบ:
Element | |||||
---|---|---|---|---|---|
input | 5.0 | 10.0 | 16.0 | 5.1 | 10.6 |
meter | 8.0 | Not supported | 6.0 | 6.0 | 11.0 |
progress | 8.0 | 10.0 | 16.0 | 6.0 | 11.0 |