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 trial

JavaScript JavaScript Foundations Variables Basics

Tommy Gebru
Tommy Gebru
30,164 Points

Please help JavaScript

In the myscript.js file, on line 6, get the element by the id of "container" Bummer! You haven't set the id to 'container'. Remember not to use a '#'.

/* JavaScript Foundations: Variables */
var bgColor = "blue";
var textColor = "#FF9933";

var container = document.getElementById('title');
container.style.background = bgColor;
container.style.color = textColor;

3 Answers

Well, right now, the code on the line 6 (var container = document.getElementById('title');) is looking for an element with the id title. You want to replace that with the id specified in the challenge (container).

change this var container = document.getElementById('title'); by var container = document.getElementById('container');

Tommy Gebru
Tommy Gebru
30,164 Points

Hey Ilyass,

Thx for the support, but there has already been a Best Answer selected, this will stand out as a model for what has been most helpful for me personally and what may help others. Keep up the good work!

Tommy Gebru
Tommy Gebru
30,164 Points

<code> The identical() method is being called but the variables are not identical. See if you can fix the code. Bummer! Try the strict equality operator. </code>

  var myUndefinedVariable = null;
        var myNullVariable = null;

        if (myNullVariable == myUndefinedVariable) {
            identical();
        }

I have tried applying (===) but I get different messages