title: Why does $.get keep coming up as an empty alert?
body: <p>I'm trying to get the <code>href</code> of <code>&lt;span id=&quot;username&quot;&gt;</code> from another page on my website.</p>
  <p>The jQuery:</p>
  <pre><code>var fetchedInfo;
  $.get(&quot;./profile&quot;, function(res) {
     fetchedInfo = $(res).find(&quot;span#username&quot;).attr(&quot;href&quot;);
     alert(fetchedInfo);
  });
  </code></pre>
  <p>HTML:</p>
  <pre><code>&lt;div class=&quot;linkdiv&quot;&gt;
      &lt;span class=&quot;profile&quot; id=&quot;username&quot;&gt;
          &lt;a href=&quot;https://example.com&quot;&gt;text&lt;/a&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Every answer I've tried from StackOverflow has resulted in a blank Alert. I'm not sure if there's something way deeper going on from my end of things or if it's still (hopefully) a fixable code issue...</p>
  <p>Thank you for any help.</p>