console.log(text);
console.log("Who's Joe?")
console.log("Text");
var randomText = "randomText";
console.log(randomText);
console.err("Error: U Looked at this comment");
//Logs an error.
console.log("print")
//or
alert("Print")
document.write("Hello world");
window.print()
function printpage(){
var originalContents = document.body.innerHTML;
var printReport= document.getElementById('div1').innerHTML;
document.body.innerHTML = printReport;
window.print();
document.body.innerHTML = originalContents;
}
console.log("Aighte, bet");
console.log(text);
//javascript print full webpage
print()
console.log("text you want to log")
console.log("Your text")
<form method="post" action="#" id="printJS-form">
...
</form>
<button type="button" onclick="printJS('printJS-form', 'html')">
Print Form
</button>
console.log("hi usr")
;console.log(text)
//print in the window
document.write("Have a nice day!");
//print in the console log (Right click->Inspect ->Console)
console.log("Have a nice day!");
<body onLoad="window.print()">
ou en mettant ce bout de script en début de page entre <head> et </head>
<script language="javascript">
<!--
window.print()
//-->
</script>
console.log('text here')
console.log(a); // write to the browser console
document.write(a); // write to the HTML
alert(a); // output in an alert box
confirm("Really?"); // yes/no dialog, returns true/false depending on user click
prompt("Your age?","0"); // input dialog. Second argument is the initial value