Created
July 27, 2016 01:37
-
-
Save ajmalafif/a11b68d9a9fa0393db7559e1644aa657 to your computer and use it in GitHub Desktop.
UA data attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = document.documentElement; | |
b.setAttribute('data-useragent', navigator.userAgent); | |
b.setAttribute('data-platform', navigator.platform ); | |
b.className += ((!!('ontouchstart' in window) || !!('onmsgesturechange' in window))?' touch':''); | |
// Source: http://rog.ie/blog/html5-boilerplate-addon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment