Hello, why is it that when I try to code function drawText(), it will not run?
Can you post your full code? Also, what tutorial are you using? We will take a look
I’m using the JavaScript Absolute Beginner’s Guide. I’m on Ch. 5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loops!</title>
<style>
</style>
</head>
<body>
<script>
for (let i = 0; i > 10; i++) {
saySomething();
}
function saySomething() {
document.writeIn("hello!")
}
</script>
</body>
</html>
You were very close. The document.writeIn("hello!")
is actually document.writeln("hello!")
. This is a very subtle spelling mistake.
It has to do with the spelling of writeln. It is short for writeline. What you have as a capital “I” should actually be a lowercase “L”
Once you make that one letter change, your code should work!