diff --git a/lib/select.js b/lib/select.js
index <HASH>..<HASH> 100644
--- a/lib/select.js
+++ b/lib/select.js
@@ -85,20 +85,15 @@ var selectors = {
     op = operators[op];
     return function(el) {
       var attr;
-      switch (key) {
-        case 'for':
-          attr = el.htmlFor;
-          break;
-        case 'class':
-          attr = el.className;
-          break;
-        case 'href':
-          attr = el.getAttribute('href', 2);
-          break;
-        default:
-          attr = el[key] != null ? el[key] : el.getAttribute(key);
-          break;
-      }
+      if (key == 'for')
+        attr = el.htmlFor;
+      else if (key == 'class')
+        attr = el.className;
+      else if (key == 'href')
+        attr = el.getAttribute('href', 2);
+      else
+        attr = key in el ? el[key] : el.getAttribute(key);
+
       return attr != null && op(attr + '', val);
     };
   },
Replaced unoptimized switched by if/else