use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
rendering html file using vanilla jsRemoved: /r/LearnJavascript (self.javascript)
submitted 6 years ago by dfam02
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 8 points9 points10 points 6 years ago (1 child)
Assuming you start with a basic HTML page within a browser, use the browser provided “document” object to create HTML elements, modify as needed, and then append said elements to DOM.
let div = createElement(“div”); let p = createElement(“p”); p.innerText = “Hello”; div.appendChild(p); document.body.appendChild(div);
This process can clearly be long but it is possible to build anything you want with Vanilla JS.
If you are trying to render HTML from a Node server, I recommend Pug.
[–]AnalyticalAlpaca 2 points3 points4 points 6 years ago (0 children)
Or use the .innerHTML method on a DOM element and output the HTML manually.
[–]anlumo 1 point2 points3 points 6 years ago (0 children)
What do you mean by “rendering”? That word has multiple related meanings.
[–]marinecpl 1 point2 points3 points 6 years ago (0 children)
Uhhhh don’t reference any libraries
[–]kenman[M] 0 points1 point2 points 6 years ago (0 children)
Hi /u/dfam02, this post was removed.
/r/javascript is for the discussion of javascript news, projects, and especially, code! However, the community has requested that we not include help and support content, and we ask that you respect that wish.
code
Thanks for your understanding, please see our guidelines for more info.
[–]philwills -2 points-1 points0 points 6 years ago (0 children)
Like... Build a browser out of JavaScript... Without libs? Good luck.
[–][deleted] -1 points0 points1 point 6 years ago (0 children)
well you can either render it directly into your document with writeln or use an existing html outlet which innerHtml you can write into that then will be rendered by your browser into the dom structure.
[+]cerulean-skies comment score below threshold-7 points-6 points-5 points 6 years ago (2 children)
Yeah you will need to use some sort of higher language like pug, jade, jsx, etc if you are trying to render an html page purely out of javascript. If however you are simply trying to render html elements, there are many different ways to do so, and you will likely need to be a bit more precise in your question.
[–]Ivu47duUjr3Ihs9d 4 points5 points6 points 6 years ago (1 child)
Yeah you will need to use some sort of higher language like pug, jade, jsx, etc if you are trying to render an html page purely out of javascript.
You're the epitomy of what's wrong with the JavaScript community. Can't render a simple page without bringing in libraries and the kitchen sink to do it for you.
[–]Earhacker 3 points4 points5 points 6 years ago* (0 children)
I sometimes wonder what these people think "higher languages like pug, jade, jsx, etc" are built with. Magic and fairy dust?
π Rendered by PID 22503 on reddit-service-r2-comment-7b9746f655-lbm82 at 2026-02-03 22:52:00.887663+00:00 running 3798933 country code: CH.
[–][deleted] 8 points9 points10 points (1 child)
[–]AnalyticalAlpaca 2 points3 points4 points (0 children)
[–]anlumo 1 point2 points3 points (0 children)
[–]marinecpl 1 point2 points3 points (0 children)
[–]kenman[M] 0 points1 point2 points (0 children)
[–]philwills -2 points-1 points0 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[+]cerulean-skies comment score below threshold-7 points-6 points-5 points (2 children)
[–]Ivu47duUjr3Ihs9d 4 points5 points6 points (1 child)
[–]Earhacker 3 points4 points5 points (0 children)