onbeforeprint 사용 문서가 HTML로 인쇄되기 전에 스크립트를 실행하기 위한 속성입니다.
예시
다음 코드를 실행하여 onbeforeprint를 구현할 수 있습니다. 속성 -
<!DOCTYPE html>
<html>
<body onbeforeprint = "display()">
<script>
function display() {
alert("The document will now print.");
}
</script>
</body>
</html>