วัตถุHTML DOM HR
วัตถุทรัพยากรบุคคล
วัตถุ HR แสดงถึงองค์ประกอบ HTML <hr>
เข้าถึง HR Object
คุณสามารถเข้าถึง <hr> องค์ประกอบโดยใช้ getElementById():
ตัวอย่าง
var x = document.getElementById("myHR");
สร้าง HR Object
คุณสามารถสร้าง <hr> องค์ประกอบโดยใช้ document.createElement() วิธีการ:
ตัวอย่าง
var x = document.createElement("HR");
คุณสมบัติของวัตถุ HR
Property | Description |
---|---|
align | Not supported in HTML5. Use style.textAlign instead. Sets or returns the alignment of a horizontal line |
color | Not supported in HTML5. Use style.color instead. Sets or returns the color of a horizontal line |
noshade | Not supported in HTML5. Sets or returns whether a horizontal line should render in one solid color (noshaded) |
size | Not supported in HTML5. Use style.height instead. Sets or returns the height of a horizontal line |
width | Not supported in HTML5. Use style.width instead. Sets or returns the width of a horizontal line |
คุณสมบัติและเหตุการณ์มาตรฐาน
ออบเจ็กต์ HR ยังสนับสนุนคุณสมบัติและเหตุการณ์ มาตรฐาน อีกด้วย
หน้าที่เกี่ยวข้อง
การอ้างอิง HTML: แท็ก HTML <hr>