Skip to content

Instantly share code, notes, and snippets.

@bloodyowl
Last active April 20, 2016 17:53
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bloodyowl/4340751 to your computer and use it in GitHub Desktop.
Save bloodyowl/4340751 to your computer and use it in GitHub Desktop.
Smallest HTML5 shim ever

Smallest HTML5 shim ever

130 bytes, that's what it takes.

Script

"header footer section aside nav article figure figcaption hgroup time main".replace(/\w+/g,function(a){document.createElement(a)})

Usage

Place this in <head></head>.

<script>"header footer section aside nav article figure figcaption hgroup time main".replace(/\w+/g,function(a){document.createElement(a)})</script>
@PhenX
Copy link

PhenX commented Dec 20, 2012

Why ; and parenthesis around the string ?

@bloodyowl
Copy link
Author

Useless actually, updated.

@bloodyowl
Copy link
Author

14/03/2013 : Added <main> support.

@MoOx
Copy link

MoOx commented Mar 15, 2014

Usage should be wrapped by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment