所以我在HTML代码的头部有以下元标记。
有什么建议吗?
<html>
<head>
<meta property="article:tag" content="This is an apple" />
<meta property="article:tag" content="This is a pear" />
</head>
我想检查是否存在内容为"this is an apple"的meta标签。但出于某种原因,我的提示框总是运行为真。
if (document.querySelectorAll('meta[content="This is an apple"]') != null) {
alert('Its here!');
}
有什么建议吗?