사용자가 요소의 텍스트를 자르면 복사 중 HTML의 속성 트리거
예시
다음 코드를 실행하여 oncopy를 구현할 수 있습니다. 속성 -
<!DOCTYPE html>
<html>
<body>
<input type = "text" oncopy="display()" value = "Copy me">
<h2 id = "test">Try to copy the above text.</h2>
<script>
function display() {
document.getElementById("test").innerHTML = "Your copied text worked!";
}
</script>
</body>
</html>