title: Javascript check for native placeholder support in IE8
body: <p><strong>tldr:</strong>
  Why does ('placeholder' in inputElemnt) equal true in IE8 despite no native support for the placeholder attribute? Isn't (attribute in element) a good way to check for native support? The Javascript library Modernizer use it. </p>
  
  <p><strong>Long:</strong>
  <del>I have a small Jquery plugin called Defaultvalue ( <a href="http://unwrongest.com/projects/defaultvalue/" rel="nofollow">http://unwrongest.com/projects/defaultvalue/</a> ).</del> I have a small Jquery plugin called Placeholder ( <a href="https://github.com/janjarfalk/jquery.placeholder.js" rel="nofollow">https://github.com/janjarfalk/jquery.placeholder.js</a> ). It's basically a fallback for the HTML5 placeholder attribute.</p>
  
  <p>In a recent updated I added these three lines of code. Hoping that Defaultvalue wouldn't run if the browser had native support for the placeholder attribute.</p>
  
  <pre>
  if('placeholder' in this){
      // this is an input-element
      return false;
  }
  </pre>
  
  <p>It seems to work in most browsers except IE8 and IE7. For some reason it finds the key 'placeholder' in this, but there isn't, I think, any support for the placeholder attribute in IE7/IE8.</p>
  
  <p>My code was inspired by this code in the Javascript library Modernizer ( <a href="http://www.modernizr.com/" rel="nofollow">http://www.modernizr.com/</a> ).</p>
  
  <pre>
  (function(props) {
      for (var i = 0, len = props.length; i &lt; len; i++) {
          attrs[ props[i] ] = !!(props[i] in inputElem);
      }
      return attrs;
  })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
  </pre>
  
  <p>What am I missing?</p>