I have this html
<a data-overlay="Preparing First" href='#'>First link</a>
<a data-overlay="Preparing Second" href='#'>Second link</a>
And JS
$("[data-overlay]").click(function () {
var text = $(this).val($(this).attr("data-overlay"));
alert(text);
});
When I do this, I got only OBJECT, where I got wrong?
Here is working fiddle
What I need is to alert value of that custom attribute?