What’s the best way of checking if a DOM textnode is a link? This following code checks if the node is immediately wrapped in an anchor tag, but wouldn’t work if the tag is further up the tree…
if (myTextnode.parentNode.tagName !== 'A') {
//do something
}
Just climb up the tree.