title: attr() returning undefined
body: <p>I am setting a value in the attribute but it's giving me <code>undefined</code> when retrieving it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $("#search_field").attr("selectedvale", 'dsds')
    var aaa = $("#search_field").attr("selectedvale");
    alert(aaa)
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    padding: 5px;
  }
  
  label {
    font-weight: bold;
  }
  
  input[type=text] {
    width: 20em
  }
  
  p {
    margin: 1em 0 0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;label for="search_field"&gt;Address&lt;/label&gt;
  &lt;input type='text' class='address_field' /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/cq42h17p/" rel="nofollow noreferrer">https://jsfiddle.net/cq42h17p/</a></p>