I’m trying to check if a link already exists by it href property in a HTML document before to add another one.
The code is just like:
if (!$('a[href*="#businessInfoMenu"]')){
//add new link
}
Does anyone made something like that?
Thanks in advance,
You can check the
lengthof the selector to see if there were any matches: