div1
div2
div4
{"ScriptPreparationCode":"function createHideCssClass() {\r\n var style = document.createElement(\u0027style\u0027);\r\n style.type = \u0027text/css\u0027;\r\n style.innerHTML = \u0027.hide { display: none; }\u0027;\r\n document.getElementsByTagName(\u0027head\u0027)[0].appendChild(style);\r\n}\r\n\r\nvar container = document.getElementById(\u0027container\u0027);\r\nvar div4 = document.getElementById(\u0027div4\u0027);\r\n\r\nfunction createAppendDiv() {\r\n var div3 = document.createElement(\u0027div\u0027);\r\n div3.setAttribute(\u0027id\u0027, \u0027div3\u0027);\r\n var content = document.createTextNode(\u0027div3\u0027);\r\n div3.appendChild(content);\r\n container.insertBefore(div3, div4);\r\n}\r\n\r\nfunction removeDiv() {\r\n var div3 = document.getElementById(\u0027div3\u0027);\r\n div3.remove();\r\n}\r\n\r\nfunction hideDiv() {\r\n var div2 = document.getElementById(\u0027div2\u0027);\r\n div2.classList.add(\u0027hide\u0027);\r\n}\r\n\r\nfunction showDiv() {\r\n var div2 = document.getElementById(\u0027div2\u0027);\r\n div2.classList.remove(\u0027hide\u0027);\r\n}\r\n\r\ncreateHideCssClass();\r\nvar times = 100000;","TestCases":[{"Name":"Create and append/remove","Code":"for (var i=0; i\u003C times; i\u002B\u002B) {\r\n createAppendDiv();\r\n removeDiv();\r\n}","IsDeferred":false},{"Name":"display:block/display:none","Code":"for (var i=0; i\u003C times; i\u002B\u002B) {\r\n hideDiv();\r\n showDiv();\r\n}","IsDeferred":false}]}