title: Jquery $this or each() to specify one link at a time
body: <p>Im finding jQuery to difficult to learn as there seems to be many ways to write the same thing.</p>
  
  <p>As an exercise I would like to take the text within anchor tags and stuff it into the links href attribute.</p>
  
  <p>eg</p>
  
  <pre><code>&lt;a href=""&gt;http://www.something.com&lt;/a&gt;
  </code></pre>
  
  <p>to become</p>
  
  <pre><code>&lt;a href="http://www.something.com"&gt;http://www.something.com&lt;/a&gt;  
  </code></pre>
  
  <p>my first attemp was</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  var text = $('a').text();
  
  $('a').attr( 'href', text );
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>which clearly doesnt work as I need to specify to do this action for each link.</p>
  
  <p>Should I use a foreach loop? A .each() function? Or $this notation?
  Would they all work?</p>