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 trialChris Keyes
5,258 Pointsgrrrrrrrr
What am I missing with this question?
2 Answers
Ben Farr
14,855 PointsTry this below. First code is html and second is javascript
<!DOCTYPE html>
<html lang="en">
<head>
<title> JavaScript Foundations: Variables</title>
<style>
html {
background: #FAFAFA;
font-family: sans-serif;
}
</style>
</head>
<body>
<h1 id="title">JavaScript Foundations</h1>
<h2>Variables: Basics</h2>
<div id="container">
This is a div with the id of "container"
</div>
</body>
<script src="myscript.js"></script>
</html>
/* JavaScript Foundations: Variables */
var bgColor = "blue";
var textColor = "#FF9933";
var container = document.getElementById('container');
container.style.background = bgColor;
container.style.color = textColor;
Chris Keyes
5,258 PointsTHANKS!!!
Chris Keyes
5,258 Pointswow ... I wasn't including the # in text color. I guess I was ready for a break. Thanks so much for your answers!!!
Dino Paškvan
Courses Plus Student 44,108 PointsDino Paškvan
Courses Plus Student 44,108 PointsWhat task are you on? And what have you tried so far?