BCD tables only load in the browser
非推奨
この機能はウェブ標準から削除されました。まだ対応しているプラウザーがあるかもしれませんが、ゆくゆくはなくなるものです。使用を避け、できれば既存のコードを更新してください。このページの下部にあるブラウザーの対応を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。
HTMLElement.contextMenu
プロパティは、contextmenu
属性を使用して要素に割り当てられたコンテキストメニューを参照します。 メニュー自体は、<menu>
要素を使用して作成されます。
var elementContextMenu = element.contextMenu;
var contextMenu = document.getElementById("element").contextMenu;
// 最初のメニューエントリのラベルを変更する
contextMenu.firstElementChild.label = "新しいラベル";
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.