I would recommend using the custom
data-
attribute on the element. Make your link look something like...
<a href="some link" id="infoLink" data-clicked="false" ...="">
</a>
then using the
attr()
function in jQuery you can read and set the value.
Example:
$("#nextButton").click(function(event) {
if(false == $("#infoLink").attr("data-clicked")) {
event.stopPropagation();
}
});
$("#infoLink").click(function() {
$(this).attr("data-clicked", "true");
});