Hacker News new | ask | show | jobs
by aaronblohowiak 5038 days ago
innerHTML is an easy one, try setting an attribute -- you have to create a new attribute node, set its value and then add that to the element..
3 comments

> you have to create a new attribute node, set its value and then add that to the element..

Erm... no you don't: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68F082

You should set the node property instead (e.g. standard textContent or innerText). It will work everywhere.
setAttribute()?
IE8 =(