Href
Add and remove hRefs
by ajo4you
HTML
<div> <a href="" class="filterLink">link</a>
<br /> <a href="" class="filterL">link</a>
<br /> <a href="" class="filterLink">link</a>
<br />
</div>
<input type="button" id="save" value="save" onclick="removeMe();" />
<input type="button" id="edit" value="edit" onclick="addMe();" />
CSS
.disabled {
text-decoration:none;
color: black;
}
JavaScript
$('document').ready(function () {
$('.filterL').click(function () {
if ($(this).hasClass('disabled')) {
return false;
}
$(this).addClass('disabled');
//$(this).siblings().removeClass('disabled');
return false;
});
});
function removeMe() {
$(".filterLink").removeAttr("href");
}
function addMe() {
$(".filterLink").attr("href",'#');
}