I have the following:
if ($(this).attr("data-disabled") === "false") {
var $link = $(this);
$("a.accessLink").each(function () {
$(this).attr("data-disabled", "true");
});
dialog($link);
}
Am I correct in saying this could be replaced with:
if ($(this).data("disabled") === "false") {
var $link = $(this);
$("a.accessLink").each(function () {
$(this).data("disabled", "true");
});
dialog($link);
}
Also is there a better way for me to set all the data-disabled attributes of links with the accessLink class to a value of “disabled”?
1 Answer