 <p>If you want to the particular value on click of particular link then you can use this code.</p> <pre><code>var data = document.getElementsByClassName("call"); var numbers = []; for (var i = 0; i &lt; data.length; i++) { data[i].onclick = getNumber; } function getNumber(){ numbers.push(this.dataset['number']); alert(this.dataset['number']); } </code></pre> <p>Here is the <a href="http://jsfiddle.net/VykGN/2/" rel="nofollow">DEMO</a></p> <p>There is no <strong>number</strong> property on anchor tag, so for your need we can use <strong>data-*</strong> property which allows you to store needful information on html.</p>