title: How can I get placeholder attribute value using jquery?
body: <p>I am trying to get the <code>placeholder</code> attribute value and do a <code>fadeIn</code> with the label which has the <code>placeholder</code> value as a <code>for</code> value, but it's not working.</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;html&gt;  
      &lt;body&gt;
          &lt;form&gt;
              &lt;input type="text" id="name" name="name" placeholder="First Name" /&gt;
              &lt;label for="First Name"&gt;First Name &lt;/label&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>CSS:</strong>  </p>
  
  <pre><code>input+label { display: none; }  
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>$(document).ready(function() {
      $('input[type="text"]').click(function() {  
          var sd = $(this).attr('placeholder');  
          $('label[for^=sd]').fadeIn();  
      });  
  });
  </code></pre>