DOM

HTMLElement:copy イベント

 編集:2022.10.02 by T.A.

[Edge]○。→

ユーザーがブラウザーのユーザー インターフェイスからコピー操作を実行したときに発生します。

バブリング ¶あり
キャンセル ¶可能
インターフェイス ClipboardEvent
イベント ハンドラー プロパティ oncopy

HTML:

<div id=IdTest contenteditable>ここでコピー操作してみてください。</div>
<TEXTAREA id=IdArea>ここに貼り付けしてみてください。</TEXTAREA>

JavaScript:

function Job(eve){
  D=eve; //=[object]:[object ClipboardEvent]
詳細 //isTrusted=[boolean]:true //clipboardData=[object]:[object DataTransfer] //type=[string]:copy //target=[object]:[object HTMLDivElement] //currentTarget=[object]:null //eventPhase=[number]:0 //bubbles=[boolean]:true //cancelable=[boolean]:true //defaultPrevented=[boolean]:false //composed=[boolean]:true //…
let E=eve.target; E.style.backgroundColor="#fee"; } IdTest.oncopy=Job;

DataTransfer


テスト