【发布时间】:2018-05-17 17:06:39
【问题描述】:
我想在我的 chrome 扩展弹出窗口中将单词 null 替换为单词 REPLACED
我的 HTML
<!DOCTYPE html>
<html>
<head>
<script src="popup.js" type="text/javascript"></script>
</head>
<body>
<h1> Wordnik Lookup </h1>
<p id = "userselect">null</p>
</body>
</html>
我的 popup.js:
document.getElementyById("userselect").innerHTML = "REPLACED!";
我从检查弹出窗口中得到的错误消息
未捕获的类型错误:document.getElementyById 不是函数
对此的任何帮助将不胜感激:)
【问题讨论】:
-
你有
getElementyById(t 和 B 之间的额外 y)而不是getElementById