📌  相关文章
📜  queryselector 带有文本的标签 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:32.059000             🧑  作者: Mango

代码示例1
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`.