사용자가 요소의 텍스트를 붙여넣을 때 붙여넣기 HTML의 속성 트리거
예시
다음 코드를 실행하여 붙여넣기 를 구현할 수 있습니다. 속성 -
<!DOCTYPE html>
<html>
<body>
<input type = "text" onpaste = "display()" value = "Paste text here">
<h2 id = "test">Try to paste any text.</h2>
<script>
function display() {
document.getElementById("test").innerHTML = "Your pasted text worked!";
}
</script>
</body>
</html>