I am trying to figure out how to disable links within a specific div. What I currently have is this...
function Lock() {
var obj = document.getElementById("tempplateInfo");
obj.disabled = 'true';
$(function () {
//grab all a tags
$('a').each(function () {
//click on a link....
$(this).click(function () {
alert($(this).attr('href') + ' is not available');
//disable link
return false;
});
});
});
}
This currently select all the link on the page. I don't want all the links, just the few that are inside of a div?
Anyway to get that done... I thought about 'divId a'. But that didn't work at all, all the links were suddenly available. I am doing this using jquery btw.
You need to learn jQuery selectors.
You want #someId a.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With