In JavaScript, which method is used to display content in browser ?
Answers
Answered by
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
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
Accountancy,
2 months ago
Social Sciences,
2 months ago
Physics,
2 months ago
Social Sciences,
5 months ago
Science,
5 months ago
Math,
10 months ago
India Languages,
10 months ago