Duckduckgo
D
G
Qwant
Q
W
StartPage
S
P
Wikipedia
W
Piped
Y
Openstreetmap
O
QwantMaps
F
DuckduckgoImages
D
Reddit
R
IMDB
T
HackerNews
S
Whois
E
Opensubtitles
X
Podnapisi
L
{"ScriptPreparationCode":null,"TestCases":[{"Name":"Vanilla","Code":"document.getElementById(\u0022main\u0022).style.backgroundColor = \u0022pink\u0022;\r\n\r\nArray.from(document.getElementsByClassName(\u0022search-label\u0022)).forEach((e) =\u003E {\r\n e.style.backgroundColor = \u0022yellow\u0022;\r\n});\r\n\r\ndocument.getElementsByClassName(\u0022search-label\u0022)[5].style.backgroundColor = \u0022black\u0022;","IsDeferred":false},{"Name":"JQuery","Code":"$(\u0022#main\u0022).css(\u0022background-color\u0022, \u0022pink\u0022);\r\n\r\n$(\u0022.search-label\u0022).css(\u0022background-color\u0022, \u0022yellow\u0022);\r\n\r\n$(\u0022.search-label:eq(5)\u0022).css(\u0022background-color\u0022, \u0022black\u0022);","IsDeferred":false},{"Name":"Function 1","Code":"function getEle(ele, n) {\r\n if (ele.split(\u0022 \u0022).length === 1) {\r\n if (/#/.test(ele)) {\r\n return document.getElementById(ele.slice(1));\r\n } else if (typeof n === \u0022undefined\u0022) {\r\n return Array.from(document.getElementsByClassName(ele.slice(1)));\r\n } else {\r\n return document.getElementsByClassName(ele.slice(1))[n];\r\n }\r\n } else if (typeof n === \u0022undefined\u0022) {\r\n return document.querySelectorAll(ele);\r\n } else {\r\n return document.querySelectorAll(ele)[n];\r\n }\r\n}\r\n\r\ngetEle(\u0022#main\u0022).style.backgroundColor = \u0022pink\u0022;\r\n\r\ngetEle(\u0022.search-label\u0022).forEach((e) =\u003E {\r\n e.style.backgroundColor = \u0022yellow\u0022;\r\n});\r\n\r\ngetEle(\u0022.search-label\u0022, 5).style.backgroundColor = \u0022black\u0022;","IsDeferred":false},{"Name":"Function 2","Code":"function getEle(ele, n) {\r\n switch (true) {\r\n case ele.split(\u0022 \u0022).length === 1 \u0026\u0026 /#/.test(ele):\r\n return document.getElementById(ele.slice(1));\r\n case ele.split(\u0022 \u0022).length === 1 \u0026\u0026 typeof n === \u0022undefined\u0022:\r\n return Array.from(document.getElementsByClassName(ele.slice(1)));\r\n case ele.split(\u0022 \u0022).length === 1:\r\n return document.getElementsByClassName(ele.slice(1))[n];\r\n case typeof n === \u0022undefined\u0022:\r\n return document.querySelectorAll(ele);\r\n default:\r\n return document.querySelectorAll(ele)[n];\r\n }\r\n}\r\n\r\ngetEle(\u0022#main\u0022).style.backgroundColor = \u0022pink\u0022;\r\n\r\ngetEle(\u0022.search-label\u0022).forEach((e) =\u003E {\r\n e.style.backgroundColor = \u0022yellow\u0022;\r\n});\r\n\r\ngetEle(\u0022.search-label\u0022, 5).style.backgroundColor = \u0022black\u0022;","IsDeferred":false},{"Name":"Function 3","Code":"function getEle(ele) {\r\n if (ele.split(\u0022 \u0022).length === 1) {\r\n if (/#/.test(ele)) {\r\n return document.getElementById(ele.slice(1));\r\n } else {\r\n return Array.from(document.getElementsByClassName(ele.slice(1)));\r\n }\r\n } else {\r\n return document.querySelectorAll(ele);\r\n }\r\n}\r\n\r\ngetEle(\u0022#main\u0022).style.backgroundColor = \u0022pink\u0022;\r\n\r\ngetEle(\u0022.search-label\u0022).forEach((e) =\u003E {\r\n e.style.backgroundColor = \u0022yellow\u0022;\r\n});\r\n\r\ngetEle(\u0022.search-label\u0022)[5].style.backgroundColor = \u0022black\u0022;","IsDeferred":false},{"Name":"Function 4","Code":"function getEle(ele) {\r\n switch (true) {\r\n case ele.split(\u0022 \u0022).length === 1 \u0026\u0026 /#/.test(ele):\r\n return document.getElementById(ele.slice(1));\r\n case ele.split(\u0022 \u0022).length === 1:\r\n return Array.from(document.getElementsByClassName(ele.slice(1)));\r\n default:\r\n return document.querySelectorAll(ele);\r\n }\r\n}\r\n\r\ngetEle(\u0022#main\u0022).style.backgroundColor = \u0022pink\u0022;\r\n\r\ngetEle(\u0022.search-label\u0022).forEach((e) =\u003E {\r\n e.style.backgroundColor = \u0022yellow\u0022;\r\n});\r\n\r\ngetEle(\u0022.search-label\u0022)[5].style.backgroundColor = \u0022black\u0022;","IsDeferred":false}]}