diff --git a/htmlparser2/htmlparser2-tests.ts b/htmlparser2/htmlparser2-tests.ts
index c002da0e2..53f6ee2aa 100644
--- a/htmlparser2/htmlparser2-tests.ts
+++ b/htmlparser2/htmlparser2-tests.ts
@@ -6,7 +6,7 @@ import htmlparser = require("htmlparser2");
var parser = new htmlparser.Parser({
onopentag: (name:string, attribs:{[s:string]:string}) => {
- if(name === "script" && attribs.type === "text/javascript"){
+ if(name === "script" && attribs['type'] === "text/javascript"){
console.log("JS! Hooray!");
}
},