How unique is the tag document.write() in JS? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How unique is the tag document.write() in JS?

I want to where to use and how to use document.write() in an HTML DOCUMENT and how different does it work apart from the HTML tags. I have this doubt coz document.write() and other elements in HTML display the words we type but the content in HTML appears before JavaScript so if anyone knows something about it help me please! 😀 Cheers People! Keep Coding and Developing ❤️👊🏻

31st Jan 2018, 11:54 AM
Raaja Thalapathy
Raaja Thalapathy - avatar
2 Answers
+ 1
You don’t use document.write() with your current html document. You can use it after document.open() method to write into the stream. To display content in the stream call document.close() method but again this will clear you current document.
31st Jan 2018, 12:25 PM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Cool got a hold to it now thanks mate ! 😁👍🏻
31st Jan 2018, 1:29 PM
Raaja Thalapathy
Raaja Thalapathy - avatar