Leran JavaScripts
Js Output
JavaScript Display: JavaScript "displays" in the following ways:An HTML element, using innerHTML.
HTML output using document.write().
An Alert box, using alert().
in Browser console, using console.log().
innerHTML
///select id of html element where you data to be displayed:
///in this case id="demo"
document.getElementById("demo").innerHTML = 3 + 4;
document.write()
///select id of html element where you data to be displayed:
///in this case id="demo"
document.getElementById("demo").document.write(3 + 4);
alert()
alert(3 + 4);
alert("John Doe");
console.log()
console.log(3 + 4);
console.log("John Doe");