{"ScriptPreparationCode":"function getTemplateInnerHTML()\r\n{\r\n\tconst template = document.createElement(\u0027template\u0027);\r\n\ttemplate.innerHTML = \u0060\r\n \u003Cdiv\u003E\r\n \u003Ch1\u003EHeading\u003C/h1\u003E\r\n \u003Cp\u003EParagraph 1\u003C/p\u003E\r\n \u003Cp\u003EParagraph 2\u003C/p\u003E\r\n \u003Cbutton\u003EButton\u003C/button\u003E\r\n \u003C/div\u003E\r\n \u0060;\r\n\r\n\tconst element = template.content.firstElementChild;\r\n const clone = element.cloneNode();\r\n\tdocument.documentElement.appendChild(clone);\r\n return clone;\r\n};\r\n\r\nfunction getTemplateNodes()\r\n{\r\n\tconst template = document.createElement(\u0027template\u0027);\r\n\r\n const element = document.createElement(\u0027div\u0027);\r\n const heading = document.createElement(\u0027h1\u0027);\r\n const para1 = document.createElement(\u0027p\u0027);\r\n const para2 = document.createElement(\u0027p\u0027);\r\n const button = document.createElement(\u0027button\u0027);\r\n\r\n heading.innerText = \u0027Heading\u0027;\r\n para1.innerText = \u0027Paragraph 1\u0027;\r\n para2.innerText = \u0027Paragraph 2\u0027;\r\n button.innerText = \u0027Button\u0027;\r\n\r\n element.appendChild(heading);\r\n element.appendChild(para1);\r\n element.appendChild(para2);\r\n element.appendChild(button);\r\n\r\n \ttemplate.content.appendChild(element);\r\n\r\n\tdocument.documentElement.appendChild(element);\r\n return element;\r\n};\r\n\r\nfunction getDocumentFragment()\r\n{\r\n\tconst fragment = document.createElement(\u0027template\u0027);\r\n\r\n const element = document.createElement(\u0027div\u0027);\r\n const heading = document.createElement(\u0027h1\u0027);\r\n const para1 = document.createElement(\u0027p\u0027);\r\n const para2 = document.createElement(\u0027p\u0027);\r\n const button = document.createElement(\u0027button\u0027);\r\n\r\n heading.innerText = \u0027Heading\u0027;\r\n para1.innerText = \u0027Paragraph 1\u0027;\r\n para2.innerText = \u0027Paragraph 2\u0027;\r\n button.innerText = \u0027Button\u0027;\r\n\r\n element.appendChild(heading);\r\n element.appendChild(para1);\r\n element.appendChild(para2);\r\n element.appendChild(button);\r\n\r\n fragment.appendChild(element);\r\n\tdocument.documentElement.appendChild(fragment);\r\n return fragment;\r\n};","TestCases":[{"Name":"Template with innerHTML","Code":"var templateInnerHTML = getTemplateInnerHTML();","IsDeferred":false},{"Name":"Template with Nodes","Code":"var templateNodes = getTemplateNodes();","IsDeferred":false},{"Name":"Document Fragment","Code":"var documentFragment = getDocumentFragment();","IsDeferred":false}]}