나는 당신이 원하는 것을 가지고 있다고 생각합니다.
<html>
<head>
<title>Print TextArea</title>
<script type="text/javascript">
function printTextArea() {
childWindow = window.open('','childWindow','location=yes, menubar=yes, toolbar=yes');
childWindow.document.open();
childWindow.document.write('<html><head></head><body>');
childWindow.document.write(document.getElementById('targetTextArea').value.replace(/\n/gi,'<br>'));
childWindow.document.write('</body></html>');
childWindow.print();
childWindow.document.close();
childWindow.close();
}
</script>
</head>
<body>
<textarea rows="20" cols="50" id="targetTextArea">
TextArea value...
</textarea>
<input type="button" onclick="printTextArea()" value="Print Text"/>
</body>
</html>
는 기본적으로이 다른 자식 창을 열고 텍스트 영역과 다른 일들이 인쇄되지 않도록 그에서 자바 스크립트 인쇄를 실행합니다 : 그것을 시도를 제공합니다.
감사합니다. 그것은 저를 위해 잘 작동합니다. – Jayashri
다행 :) – intellidiot
Btw가 질문에 'javascript'라는 태그를 추가했습니다. – intellidiot