JavaScript Various Output (Displaying Data)
In JavaScript, you can display data to the users using various "output" method provided according to your needs i.e. in a browser dialog box, in the HTML page etc. Below are some of the commonly used ways in which data can be displayed to the user: innerHTML : used to write in an HTML Element. document.write() : used to write in the HTML webpage at the place, where it is used. i.e. if it is used in the <head> tag, then it will write the HTML code in the <head> tag. window.alert() : used to display browser dialog box, with prespecified text in the alert('your text to show') method. View Dialog console.log() : used to write in the browser console. Press "ctrl+shift+i" to open developer view and then click console in chrome browser, to view browser console. Using innerHTML The innerHTML is a commonly used property of JavaScript that