From <template> to template literals to the classic createElement, what technique do you prefer to use when you need to take data, create DOM elements, and insert it into the DOM somewhere?
I do all of these, however I'll just point out that <template> isn't fully functional in IE11 and below, and even worse is template strings won't work at all. So if you need a cross-browser solution that works in older browsers, document.createElement() is your option.
Also, just a tip for older browsers that don't have <template> - if you want to add a block of multiline HTML or something into the page for templating purposes, you can put whatever you otherwise would have put into <template> in a <script> tag with a custom type="" attribute on it, and then find and work with the content of that tag in JS later:
<script type=text/html>
<h1>Multiline</h1>
<h2>HTML</h2>
<h3>Content</h3>
</script>
It depends.
If I have to create a single element, I'd go with createElement()
If I have to create something complex, I'd go with <template>, although nowadays I find myself using Web Components.
MOHD SHAH RIZAL BIN AZMAN
Hey i have create BIGCRYPTO001