{"ScriptPreparationCode":"var it = document.getElementById(\u0022it\u0022);\r\n\r\nfunction closestParent(element, className) {\r\n if (element.classList.contains(className)) return element;\r\n if (!element.parentNode) return null;\r\n if (element.parentNode.classList.contains(className)) return element.parentElement;\r\n return null;\r\n }","TestCases":[{"Name":"parentElement","Code":"while (it !== null \u0026\u0026 it.className.indexOf(\u0022span\u0022) === -1) {\r\n it = it.parentElement;\r\n}","IsDeferred":false},{"Name":"closest tag","Code":"it.closest(\u0027span\u0027)","IsDeferred":false},{"Name":"closest class","Code":"it.closest(\u0027.span\u0027)","IsDeferred":false},{"Name":"closest tag class","Code":"it.closest(\u0027span.span\u0027)","IsDeferred":false},{"Name":"parentNode","Code":"while (it.className.indexOf(\u0022span\u0022) === -1) {\r\n it = it.parentNode;\r\n if(it === document) {\r\n it = null\r\n break\r\n }\r\n}","IsDeferred":false},{"Name":"closestParentNode","Code":"closestParent(it, \u0027span\u0027);","IsDeferred":false}]}