I'm trying to use the querySelectorAll() method to capture links on web pages, but I want to ignore links starting with "javascript:", or use a different protocol like "itpc: //"
Is it possible to include them in the pseudo-selector "not ()"?
document.querySelectorAll("a:not([href^=javascript]):not([href^=itpc])");
Despite the fact that the first method works fine on the current page, there is no guarantee that it will work on every page on which I will use it, so I would really like to find this colon.
source share