HN2new | past | comments | ask | show | jobs | submitlogin

The problem is that the code $element("span", text) looks harmless, appears to work, and yet is dangerously wrong.

Dynamically setting text is very common. While dynamically setting innerHTML is a rare and dangerous operation which should be explicit in the code. The alternative syntax also supported by this function $element("span", { innerHTML: html }) is much better.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: