我对JS很新,只是写了一些脚本来学习。有人能告诉我我要去哪里吗?我认为这可能只是某处的语法错误,或者我没有使用正确的功能来完成此任务。JavaScript html编辑错误
谢谢:)
HTML:
javascript • trainingHi there this is some sample text for my JS
function show() {
var text = document.getElementByID('textOff');
console.log(text); //debugging
text.id = 'mainText';
};
CSS:
body {
background-color: #17161F;
color: white;
}
#mainText {
width: 20%;
height: 30%;
font-family: Arial;
margin-left: 20%;
margin-top: 20%;
}
#textOff {
display: none;
}
+0
那么,什么应该发生和不发生? –
+0
您可能不会注意任何事情,因为1:请参阅下面的关于区分大小写的答案和2:您正在更改元素的“ID”。 –
+3
检查您的错字: 正确的语法是“getElementById”。 –