I am trying to spawn the DOM with some snowflakes.. I am getting this error in my console and no snowflakes.
Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('< span id='flake0' style='cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;position:absolute;top:-24'>• </ span>') is not a valid name.
I am not really sure what I am doing wrong here.. PHPStorm is also not giving me any hints. I am looping through all my snowflakes and they get random sizes.
Here is my code:
var container = document.getElementById("js-container");
for (let i = 0; i <= snowMax; i++) {
var content = document.createElement("<span id='flake" + i + "' style='" + snowStyles + "position:absolute;top:-" + snowMaxSize + "'>" + snowEntity + "</span>");
container.appendChild(content);
}
I also tried escaping the span with backticks, but it's not helping..