Tuesday, August 8, 2017

Ways to display content in Javascript

There are 4 ways to display the content in Javascript.


1.Using innerHTML
2.Using document.write()
3.Using window.alert()
4.console.log()


innerHTML :

           document.getElementById("display").innerHTML = "Srinivas";    



document.write() :


     document.write("Srinivas");



window.alert() :


window.alert("Hello Srinivas")

console.log() :


 console.log("Srinivas");

No comments: