how to print a text when i click something using javascript code example Example: how to code print in javascript console.log("print") //or alert("Print")