vigour-io/brisky-render

.setAttribute vs .className (doesnt work for eg. svg)

Opened this issue · 0 comments

youzi commented

For non xhtml elements (eg svg) we need to use .setAttribute to set class. It's a bit less performant so let's chiptune it. (https://jsperf.com/classname-vs-setattribute)

Note: of course IE does support setAttribute('class'... but it uses .setAttribute('className',... :/