JavaScript
function printHTML() {
printJS({
printable: 'test',
type: 'html',
targetStyles: ['*']
})
alert("sdssdsd");
}
document.getElementById("print-button").addEventListener("click", printHTML)
// Print.js
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("print-js",[],t):"object"==typeof exports?exports["print-js"]=t():e["print-js"]=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="./",t(t.s=10)}([function(e,t,n){"use strict";function r(e,t){if(e.focus(),a.a.isEdge()||a.a.isIE())try{e.contentWindow.document.execCommand("print",!1,null)}catch(t){e.contentWindow.print()}else e.contentWindow.print();t.showModal&&d.a.close(),t.onLoadingEnd&&t.onLoadingEnd()}function i(e,t){var n=[];return t.printable.forEach(function(t,r){return n.push(o(e,r))}),Promise.all(n)}function o(e,t){return new Promise(function(n){var r=e?e.getElementById("printableImage"+t):null;r&&void 0!==r.naturalWidth&&0!==r.naturalWidth?n():setTimeout(function(){o(e,t)},500)})}var a=n(2),d=n(3),l={send:function(e,t){document.getElementsByTagName("body")[0].appendChild(t);var n=document.getElementById(e.frameId);"pdf"===e.type&&(a.a.isIE()||a.a.isEdge())?n.setAttribute("onload",r(n,e)):t.onload=function(){if("pdf"===e.type)r(n,e);else{var t=n.contentWindow||n.contentDocument;t.document&&(t=t.document),t.body.innerHTML=e.htmlData,"image"===e.type?i(t,e).then(function(){r(n,e)}):r(n,e)}}}};t.a=l},function(e,t,n){"use strict";function r(e,t){return'<div...