{"ScriptPreparationCode":"Object.defineProperty(HTMLElement, \u0027From\u0027, {\r\n enumerable: false,\r\n value: (function (doc, rgx) {\r\n //https://www.measurethat.net/Benchmarks/Show/2149/0/element-creation-speed\r\n return function CreateElementFromHTML(html) {\r\n html = html.trim();\r\n var bodystart = html.indexOf(\u0027\u003E\u0027) \u002B 1, bodyend = html.lastIndexOf(\u0027\u003C\u0027);\r\n var elemStart = html.substr(0, bodystart);\r\n var innerHTML = html.substr(bodystart, bodyend - bodystart);\r\n rgx.lastIndex = 0;\r\n var elem = doc.createElement(rgx.exec(elemStart)[4]);\r\n var match; while ((match = rgx.exec(elemStart))) {\r\n if (match[1] === undefined) {\r\n elem.setAttribute(match[4], \u0022\u0022);\r\n } else {\r\n elem.setAttribute(match[1], match[3]);\r\n }\r\n }\r\n elem.innerHTML = innerHTML;\r\n return elem;\r\n };\r\n }(window.document, /(\\S\u002B)=([\u0022\u0027])(.*?)(?:\\2)|(\\w\u002B)/g))\r\n});\r\n\r\nvar domParser = new DOMParser();","TestCases":[{"Name":"Programmatic Element creation","Code":"var arr = Array(2);\r\nvar el = document.createElement(\u0027link\u0027);\r\nel.id=\u0027reddit_css\u0027;\r\nel.type=\u0027text/css\u0027;\r\nel.rel=\u0027stylesheet\u0027;\r\nel.setAttribute(\u0027data-srcprop\u0027, \u0027href\u0027);\r\nel.setAttribute(\u0027data-src\u0027, \u0027sites/reddit/zinject.reddit.css\u0027);\r\nel.async = true;\r\nel.defer = true;\r\narr[0] = el;\r\nel = document.createElement(\u0027div\u0027);\r\nel.id = \u0027somevalue\u0027;\r\nel.className = \u0027sidebar\u0027;\r\nel.innerHTML = \u0060\u003Cdiv class=\u0027sb-handle\u0027\u003E\u003C/div\u003E\u003Cdiv class=\u0027sb-track\u0027\u003E\u003C/div\u003E\u0060;\r\narr[1] = el;\r\nreturn arr;","IsDeferred":false},{"Name":"jQuery Element creation","Code":"var arr = Array(2);\r\narr[0] = $(\u0060\u003Clink id=\u0022reddit_css\u0022 type=\u0022text/css\u0022 rel=\u0022stylesheet\u0022 async defer data-srcprop=\u0022href\u0022 data-src=\u0022sites/reddit/zinject.reddit.css\u0022\u003E\u0060);\r\narr[1] = $(\u0060\u003Cdiv id=\u0027somevalue\u0027 class=\u0027sidebar\u0027\u003E\u003Cdiv class=\u0027sb-handle\u0027\u003E\u003C/div\u003E\u003Cdiv class=\u0027sb-track\u0027\u003E\u003C/div\u003E\u003C/div\u003E\u0060);\r\nreturn arr;\r\n","IsDeferred":false},{"Name":"Custom Method: HTMLElement.From() ","Code":"var arr = Array(2);\r\narr[0] = HTMLElement.From(\u0060\u003Clink id=\u0022reddit_css\u0022 type=\u0022text/css\u0022 rel=\u0022stylesheet\u0022 async defer data-srcprop=\u0022href\u0022 data-src=\u0022sites/reddit/zinject.reddit.css\u0022\u003E\u0060);\r\narr[1] = HTMLElement.From(\u0060\u003Cdiv id=\u0027somevalue\u0027 class=\u0027sidebar\u0027\u003E\u003Cdiv class=\u0027sb-handle\u0027\u003E\u003C/div\u003E\u003Cdiv class=\u0027sb-track\u0027\u003E\u003C/div\u003E\u003C/div\u003E\u0060);\r\nreturn arr;\r\n","IsDeferred":false},{"Name":"DOMParser","Code":"var arr = Array(2);\r\nvar doc = domParser.parseFromString(\u0060\u003Clink id=\u0022reddit_css\u0022 type=\u0022text/css\u0022 rel=\u0022stylesheet\u0022 async defer data-srcprop=\u0022href\u0022 data-src=\u0022sites/reddit/zinject.reddit.css\u0022\u003E\u0060, \u0027text/html\u0027);\r\narr[0] = doc.head.removeChild(doc.head.firstElementChild);\r\ndoc = domParser.parseFromString(\u0060\u003Cdiv id=\u0027somevalue\u0027 class=\u0027sidebar\u0027\u003E\u003Cdiv class=\u0027sb-handle\u0027\u003E\u003C/div\u003E\u003Cdiv class=\u0027sb-track\u0027\u003E\u003C/div\u003E\u003C/div\u003E\u0060, \u0027text/html\u0027);\r\narr[1] = doc.body.removeChild(doc.body.firstElementChild);\r\nreturn arr;","IsDeferred":false}]}