0 points

Inject HTML From a String of HTML


dashboard

Fri Apr 24 2020 11:14:39 GMT+0000 (UTC)

Posted by @Dimples #javascript #javascript #string #html

  document.body.innerHTML = string_of_html;

// Append it instead
document.body.innerHTML += string_of_html;

                                
content_copy Copy

You can use innerHTML to put that element, like above.

https://css-tricks.com/snippets/javascript/inject-html-from-a-string-of-html/