Computer Science, asked by himay1019, 5 months ago

In JavaScript, which method is used to display content in browser ?

Answers

Answered by REDNINJA
1

Answer:

JavaScript can "display" data in different ways: Writing into an HTML element, using innerHTML . Writing into the HTML output using document.write() . Writing into an alert box, using window.alert() .

Answered by dreamrob
1

Here are a few methods used to display content in the browser in JavaScript:

  • document.write()  This method is used to write output in the HTML output.
  • window.alert(): This method of JavaScript is used to display alerts on the browser window.
  • console.log():  This method is used to display data on the console. This method is only used for debugging purposes.
  • innerHTML is a property of JavaScript which contain different methods to access HTML elements by their ID, class, etc, and edit, modify and change them according to our usage.

Similar questions