Just trying to access a value in an a element
<p>I've got multiple <code>a elements</code>, that are generated on the page view by a for loop that when they are clicked, send an <code>ajax post</code> to the database, to mark the item in the database by its id, that is equal to the value in the <code>a element</code> but my code is not working, anybody have any insight on why? Thanks. </p>

<pre><code>&lt;a href='#' value='(loaded from database)' id='markAsRead'&gt;

var element = document.getElementById('markAsRead');

element.addEventListener('click', function() {
   alert(this.value);
});
</code></pre>
