Create tag html in head with a simple trick in JavaScript

in this code we are lean how to use JavaScript to create style in head tag without use
document.createElement("style") function
also you don't need to call head tag to innerHTML in head tag, this simple and useful code can you use to JavaScript let's start.
we need to this example setTimeout function to explain how it's work, settimeout not interest to make that, just for explain.
you need just this code:
document.head.innerHTML+="<style>body{background:red}<\/style>"
Create tag html in head with a simple  trick in JavaScript

© Manajmnt code

Share to :

Comments