4 ms·
What do you mean by "afraid of HTML"? I haven't used this yet, so bear that in mind, but to me this seems to be something that is more expressive than html (I
by hellerbarde 14y ago
What do you mean by "afraid of HTML"?
I haven't used this yet, so bear that in mind, but to me this seems to be something that is more expressive than html (I meant String) concatenation. That leads, in my experience, to better maintainability and thus less worries in the future.
Whether this impacts JS performance enough to be a problem, I don't know and don't have the time to test right now.
Edit: words are hard... I accidentally a few of them.
- nobodysfool 14y agoPerformance impact should be minimal. It's only 200 lines of code, and it uses string concatenation internally. Still, I see no benefit to using this rather than doing a document.createElement('div') and assigning the attributes / contents. Perhaps it's a bit faster than using document.createElement. There may be bugs in this one, as it doesn't escape attributes.