Is it possible to build an html webpage entirely out of javascript? Would you need anchors like some div elements to organize things?
1 Answer
No, you cant build an entire website out of javascript BUT if the question is can you build the website using javascript into HTML, CSS, etc yes. At the end of the day HTML and CSS is just text you can easily form these files from javascript.
2 Comments
Kartik Malik
I think the answer is YES you can have no HTML file and still have a webpage. In fact you will need not to create an HTML file using JS also. There are so many template engines out there like hbs, ejs, pug, asp., etc etc
Teemu
@KartikMalik The template engines are another story, they're hardly scoped to JavaScript only. Of course you can write a .js file and serve that from a Node.js server, but a browser still can't show anything if the loaded file doesn't contain HTML.
scripttag (plus the HTML boilerplate -DOCTYPE,html,head,bodyetc. - to be properly valid).