{"ScriptPreparationCode":"function createElement(options) {\r\n const {\r\n element,\r\n classes,\r\n id,\r\n href,\r\n attributes,\r\n text,\r\n } = options;\r\n\r\n const currentElement = document.createElement(element);\r\n if (typeof classes !== \u0027undefined\u0027) currentElement.className = classes;\r\n if (typeof id !== \u0027undefined\u0027) currentElement.id = id;\r\n if (typeof href !== \u0027undefined\u0027) currentElement.href = href;\r\n if (typeof attributes !== \u0027undefined\u0027) attributes.forEach((el) =\u003E currentElement.setAttribute(el.name, el.value));\r\n if (typeof text !== \u0027undefined\u0027) currentElement.innerHTML = text;\r\n return currentElement;\r\n};\r\nfunction createEmptySelect(placeholder, stepNumber) {\r\n const selectWrapper = createElement({\r\n element: \u0027div\u0027,\r\n classes: (stepNumber === 1) ? \u0027adv_search__select --active\u0027 : \u0027adv_search__select\u0027,\r\n });\r\n const selectButton = createElement({\r\n element: \u0027button\u0027,\r\n classes: \u0027adv_search__button\u0027,\r\n attributes: [{ name: \u0027type\u0027, value: \u0027button\u0027 }],\r\n });\r\n const selectButtonIndex = createElement({\r\n element: \u0027span\u0027,\r\n classes: \u0027adv_search__button_index\u0027,\r\n text: stepNumber,\r\n });\r\n const selectButtonContent = createElement({\r\n element: \u0027span\u0027,\r\n classes: \u0027adv_search__button_content\u0027,\r\n attributes: [{ name: \u0027data-placeholder\u0027, value: placeholder }],\r\n text: placeholder,\r\n });\r\n const selectMenu = createElement({\r\n element: \u0027div\u0027,\r\n classes: \u0027adv_search__menu\u0027,\r\n });\r\n\r\n selectButton.appendChild(selectButtonIndex);\r\n selectButton.appendChild(selectButtonContent);\r\n selectWrapper.appendChild(selectButton);\r\n selectWrapper.appendChild(selectMenu);\r\n return selectWrapper;\r\n};\r\nconst div = document.getElementById(\u0027div\u0027);","TestCases":[{"Name":"createElement","Code":"for(i=1; i \u003C 2; i\u002B\u002B) {div.appendChild(createEmptySelect(\u0027aaa\u0027, i));};\r\ndiv.innerHTML = \u0027\u0027;","IsDeferred":false},{"Name":"template String","Code":"for(i=1; i \u003C 2; i\u002B\u002B) {div.innerHTML \u002B= \u0060\u003Cdiv class=\u0022${(i === 1) ? \u0027adv_search__select --active\u0027 : \u0027adv_search__select\u0027}\u0022\u003E\u003Cbutton class=\u0022adv_search__button\u0022 type=\u0022button\u0022\u003E\u003Cspan class=\u0022adv_search__button_index\u0022\u003E${i}\u003C/span\u003E\u003Cspan class=\u0022adv_search__button_content\u0022 data-placeholder=\u0022aaa\u0022\u003Eaaa\u003C/span\u003E\u003C/button\u003E\u003Cdiv class=\u0022adv_search__menu\u0022\u003E\u003C/div\u003E\u003C/div\u003E\u0060};\r\ndiv.innerHTML = \u0027\u0027;","IsDeferred":false}]}