Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
document.body.oncopy で関数を実行したいのですが、この関数を呼び出したくない特定のクラス (div 要素に定義) があります。
これを行う方法はありますか?
私のコメントで言ったように、あなたはこのようなことをすることができます:
document.body.addEventListener('copy', function (e) { if (e.target.className === 'specific') { return; } // Continue with all permitted elements }