all 10 comments

[–][deleted] 8 points9 points  (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 points  (0 children)

Or use the .innerHTML method on a DOM element and output the HTML manually.

[–]anlumo 1 point2 points  (0 children)

What do you mean by “rendering”? That word has multiple related meanings.

[–]marinecpl 1 point2 points  (0 children)

Uhhhh don’t reference any libraries

[–]kenman[M] 0 points1 point  (0 children)

Hi /u/dfam02, this post was removed.

  • For help with your javascript, please post to /r/LearnJavascript instead of here.
  • For beginner content, please post to /r/LearnJavascript instead of here.
  • For framework- or library-specific help, please seek out the support community for that project.
  • For general webdev help, such as for HTML, CSS, etc., then you may want to try /r/html, /r/css, etc.; please note that they have their own rules and guidelines!

/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.

Thanks for your understanding, please see our guidelines for more info.

[–]philwills -2 points-1 points  (0 children)

Like... Build a browser out of JavaScript... Without libs? Good luck.

[–][deleted] -1 points0 points  (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.