+ 1
What is difference between writing html code in .html file and wrting html code in .js file in document.write() method?
2 Answers
0
//Official html document extension is "html" or "htm", you can write html from javascript that's not a problem but official way is easy and clean
https://www.sololearn.com/learn/HTML/1023/?ref=app
0
For the actual html there is no difference, the real difference is how the html is injected into the Dom doing it through JavaScript gives you the option to manipulate it or adding it to the Dom instead of writing it straight to the Dom