Thuộc tính nhãn HTML <menu>

❮ Thẻ <menu> HTML

Thí dụ

Sử dụng thuộc tính nhãn:

<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>

Định nghĩa và Cách sử dụng

Thuộc tính label chỉ định một nhãn hiển thị cho menu.

Thuộc tính nhãn thường được sử dụng để gắn nhãn các menu lồng nhau trong một menu.


Hỗ trợ trình duyệt

Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.

Attribute
label Not supported Not supported 8.0 Not supported Not supported

Cú pháp

<menu label="text">

Giá trị thuộc tính

Value Description
text Specifies a visible label for the menu

❮ Thẻ <menu> HTML