+ 2
What is difference between alert command and document.write command in JavaScript?
2 Respuestas
+ 7
An alert() displays the content in a pop up dialog box while document.write() displays the content in the actual web page.
+ 2
Alert is like a pop up message in your browser window. Document.write writes it onto the document.. which is your browser window. The DOM. Document Object Model. And I know you didn't ask but console.log() is to log the information into the debuggers console that you use.