Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatt James
1,948 PointsMy Doc ready is not working? where in my code am i going wrong?
In my HTML file
<!DOCTYPE html>
<html lang="en">
<head>
<title>JavaScript Foundations: Functions</title>
<style>
body{
background: #EEE;
font-family: sans-serif;
}
</style>
</head>
<body>
<h1>JavaScript Foundations</h1>
<script src="functions.js"></script>
<button id="action">Action</button>
<input id="text_field">
</body>
</html>
in my functions.js file
function sayHello (){
console.log("Hello World!");
}
2 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsIf that's all you have in your functions.js
file, you have a single function which isn't being called anywhere so the code isn't really going to do anything on its own.
Re-watch the video again, and you'll see that Jim invokes the function to get some output.
someFunction();
Matt James
1,948 PointsThank you so much. Yes it's because I didn't evoke it.
Richard Duncan
5,568 PointsRichard Duncan
5,568 PointsHave you tried watching the video again? what is the actual question for the code challenge?