JSFiddle - React, Tailwind, and code Playground

by rlemon

JavaScript

var head =  document.getElementsByTagName('head')[0];
['57x57', '72x72', '114x114', '144x144', '512x512'].forEach(function(size) {
    var element = document.createElement('link');
    element.rel = 'apple-touch-icon';
    // http://www.w3.org/TR/html4/struct/links.html#edef-LINK
    element.setAttribute('sizes', size); // sizes is a non-standard attribute and poopy so we have to setAttribute
    element.href = 'icon' + size + '.png';
    head.appendChild(element);
});