{"ScriptPreparationCode":"var elem = document.getElementById(\u0027test\u0027);\r\n\r\nfunction hasClass1(elem, name) {\r\n return elem.classList.contains(name);\r\n}\r\n\r\nfunction hasClass2(elem, name) {\r\n return (\u0027 \u0027 \u002B elem.className \u002B \u0027 \u0027).indexOf(\u0027 \u0027 \u002B name \u002B \u0027 \u0027);\r\n}\r\n\r\nElement.prototype.hasClass = function (name) {\r\n return (\u0027 \u0027 \u002B this.className \u002B \u0027 \u0027).indexOf(\u0027 \u0027 \u002B name \u002B \u0027 \u0027);\r\n};","TestCases":[{"Name":"ClassList Contains","Code":"var has = hasClass1(elem, \u0027stuff\u0027);","IsDeferred":false},{"Name":"ClassName IndexOf","Code":"var has = hasClass2(elem, \u0027stuff\u0027);","IsDeferred":false},{"Name":"ClassName IndexOf Prototype","Code":"var has = elem.hasClass(\u0027stuff\u0027);","IsDeferred":false}]}