Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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..


> 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 =(




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

Search: