window.print() without print dialog box w3 code example Example: how to code print in javascript console.log("print") //or alert("Print")