Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

queryselector a tag with text

var aTags = document.getElementsByTagName("a");
var searchText = "SearchingText";
var found;

for (var i = 0; i < aTags.length; i++) {
  if (aTags[i].textContent == searchText) {
    found = aTags[i];
    break;
  }
}

// Use `found`.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #queryselector #tag #text
ADD COMMENT
Topic
Name
9+6 =