Now, can someone please suggest that is there a way to hide this div or link in javascript/jquery? I can’t make use of class as well because there are several links as well with the same class name.
If you need to target the div, either place a unique identifier on the div or a class that appropriately represents the purpose of the object.
Why are you hiding it. Is it because that it is content that only logged in affiliates are supposed to see? If so, give the div a class name of “affiliate user” and apply style to the user class. Only apply a style to the affiliate class when that style applies only to affiliate and no other user-based style.
Yes, u r right, but, my issue is that i can’t edit existing code,its, encoded, need to put in my code on the page for the same existing code that i posted above.
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; ++i) {
if (links[i].href.toLowerCase().indexOf("affiliate-settings.php") >= 0) {
links[i].parentNode.style.display = "none";
break;
}
}