title: javascript alert value from a tag
body: <p>I have on a page a tag links generated from a database with an id. What im trying to do is in an alert box display the text inside the a tag.</p>
  
  <p>Ive tried to have a look to see if I can see a previous question, which I have come up with the following but all I get in the alert box is object HTMLCollection</p>
  
  <p>I have the following code:</p>
  
  <pre><code>&lt;a id="bet" onclick="addSlip();" class="btn btn-round" style="text-align: left;"&gt;'.$home-&gt;one.' &lt;span&gt;'.$home-&gt;two.'&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>function addSlip() {
      document.getElementById('bet').innerHTML=bet;
      alert(bet);
  }
  </code></pre>
  
  <p>Thanks for any constructive answers</p>