title: Javascript placeholder for IE8 is not working
body: <p>I'm trying to give placeholder workaround for IE7, IE8, and IE9. From the codes on the internet, I found the javascript, and I try to test it using simple page like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;HEAD&gt;
  &lt;script type="text/javascript"&gt;
  $('[placeholder]').focus(function() {
    var input = $(this);
    if (input.val() == input.attr('placeholder')) {
      input.val('');
      input.removeClass('placeholder');
    }
  }).blur(function() {
    var input = $(this);
    if (input.val() == '' || input.val() == input.attr('placeholder')) {
      input.addClass('placeholder');
      input.val(input.attr('placeholder'));
    }
  }).blur().parents('form').submit(function() {
    $(this).find('[placeholder]').each(function() {
      var input = $(this);
      if (input.val() == input.attr('placeholder')) {
        input.val('');
      }
    })
  });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
  &lt;input class="placeholder" type="text" name="nama" placeholder="try"&gt; 
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>which I hoped will show an input with placeholder text "try" inside on IE 8. but it's not showing anything. I've tried anything I can try outside the javascript code, like erasing the class attribute, adding complete attribute to the form tag, and else. but the placeholder still seems not shown. can you help me what's wrong with this code? I'm still new with javascript and web programming, so maybe the mistake is not immediately apparent to me.</p>
  
  <p>I got the code from <a href="https://gist.github.com/hagenburger/379601" rel="nofollow">https://gist.github.com/hagenburger/379601</a></p>