Generate javascript to create the html for you.
Creating HTML with JavaScript can be done in two different ways. Fast and possibly dangerous, or more labor intensive but safe by using the right APIs.
Let's be honest which is more convenient to write?
document.getElementById("something").innerHTML += "<div>${some_variable}</div>"
Or
let div = document.createElement("div");
div.textContent = some_variable;
document.getElementById("something").appendChild(div);
The first way is easier to write, but also vulnerable to XSS.
Especially when the HTML you want to create gets more complicated, the effort to create it with JavaScript using the secure APIs is much harder.
This is why I created ElementCreator. With ElementCreator you can simply write the HTML you want to create, and the tool automatically creates the JavaScript code to generate the HTML.
I assume that the generated code is safe, but of course I cannot guarantee this. Mistakes are human. ElementCreator is licensed under MIT license. As such it comes with no warranty.
Have you found a bug or otherwise want to contribute? ElementCreator on Github