HTML <menuitem> tag
Halimbawa
Nakakainklude ng iba't ibang <menuitem> elements na kontekstong menu:
<menu type="context" id="mymenu"> <menuitem label="Refresh" onclick="window.location.reload();" icon="ico_reload.png"> </menuitem> <menu label="Share on..."> <menuitem label="Twitter" icon="ico_twitter.png" onclick="window.open('//twitter.com/intent/tweet?text='+window.location.href);"> </menuitem> <menuitem label="Facebook" icon="ico_facebook.png" onclick="window.open('//facebook.com/sharer/sharer.php?u='+window.location.href);"> </menuitem> </menu> <menuitem label="Email This Page" onclick="window.location='mailto:?body='+window.location.href;"></menuitem> </menu>
Suporta ng Browser
IE | Firefox | Chrome | Safari | Opera |
---|---|---|---|---|
Ang Firefox 8.0 at ang mas bagong bersyon ay sumusuporta sa <menuitem> tag.
Paglalarawan at Paggamit
Ang <menuitem> tag ay naglalarawan ng command/menu item na maaaring i召唤 mula sa pop-up menu ng user.
Pagkakaiba ng HTML 4.01 at HTML 5
Ang <menuitem> ay bagong tag sa HTML5.
Atribute
new : Bagong atribute sa HTML5.
Atribute | Halaga | Paglalarawan |
---|---|---|
checked | checked | Pagpipilian ang kumita ng command/menu item pagkatapos ng pag-load ng pahina. ใช้เฉพาะตัวแปรที่มี type="radio" หรือ type="checkbox" |
default | default | ตั้งคำสั่ง/ตัวแทนเมนูเป็นคำสั่งเริ่มต้น |
disabled | disabled | กำหนดว่าคำสั่ง/ตัวแทนเมนูควรถูกปิดที่ไหน |
icon | URL | กำหนดสัญลักษณ์ของคำสั่ง/ตัวแทนเมนู |
open | open | กำหนดว่า details ควรจะมีความเห็นได้หรือไม่ |
label | text | สำคัญ กำหนดชื่อของคำสั่ง/ตัวแทนเมนู ที่จะแสดงให้ผู้ใช้เห็น |
radiogroup | groupname | กำหนดชื่อของกลุ่มคำสั่ง/ตัวแทนเมนู กลุ่มคำสั่ง/ตัวแทนเมนูจะถูกเปลี่ยนแปลงเมื่อคำสั่ง/ตัวแทนเมนู ตัวเองถูกเปลี่ยนแปลง ใช้เฉพาะตัวแปรที่มี type="radio" |
type |
|
กำหนดชนิดของคำสั่ง/ตัวแทนเมนู โดยมาตรฐานคือ "command" |
ตัวแปรทั่วไป
การสนับสนุน <menuitem> แบบ การใช้ตัวแปรทั่วไปใน HTML.
ตัวแปรเหตุ
การสนับสนุน <menuitem> แบบ ตัวแปรเหตุใน HTML.
หน้าที่เกี่ยวข้อง
คู่มืออ้างอิง HTML DOM:ตัวแทน MenuItem