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

If you nest any valid elements inside an unknown element like <asdf>...</asdf>, browsers just ignore the invalid wrapper element but still display the nested children. This fact is exploited by spec authors when introducing new tags to allow backwards compatibility: elements like canvas, video and audio all specifically allow optional children that are automatically hidden - but they won't be hidden in older browsers that don't know about the new elements. This allows you to easily define arbitrary fallback content for older browsers that don't support the new elements, just by nesting children in them.


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

Search: