<html>
<head>
<title>Print TextArea</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<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>
Subscribe to:
Post Comments (Atom)
Disable Caching Drupal 8
1. Copy and rename the sites/example.settings.local.php to sites/default/settings.local.php: $ cp sites / example . settings . local . ph...
-
1. Copy and rename the sites/example.settings.local.php to sites/default/settings.local.php: $ cp sites / example . settings . local . ph...
-
Returns the string str with all occurrences of the string from_str replaced by the string to_str . REPLACE() performs a case-...
-
String.prototype.sprintf = function(a) { if (a.length) { var i = -1; // start at minus 1 return this.replace(/\%(d|s|f...
This comment has been removed by the author.
ReplyDelete