3. Variables by modifying with ID


#1

In the hint section, it says "Remember, you can modify things directly using an id or class.". I've added an ID to index.html.

<!DOCTYPE html>
<html>
	<head>
		<title>Simplify, Simplify</title>
        <script type='text/javascript' src='script.js'></script>
	</head>
	<body>
        <div> Remember!
            <ul>
                <li>
                    <ol>
                        <li>Start with the function keyword</li>
                        <li>Inputs go between ()</li>
                        <li>Actions go between {}</li>
                        <li id="falseInformation">jQuery is for chumps!</li>
                    </ol>
                </li>
                <li>Inputs are separated by commas.</li>
                <li>Inputs can include other functions!</li>
            </ul>
        </div>   
	</body>
</html>

I've tried targeting this ID in script.js, for example with this.

// Write your jQuery code on line 3!
$(document).ready(function() {
    var $target = $(".falseInformation");
    $target.fadeOut('fast');
});

But it's wrong. How do I target it? Of course, I've seen solutions like var $target = $('ol li:nth-child(4)'); on the forum, but no topic brings this targeting up. Is it possible to do it the way I set out to? How else would I use an ID or class?

Thanks


#2

Lesson 6 covers this. I mistakenly entered var $target = $(".falseInformation"); instead of var $target = $("#falseInformation");

When correcting this, it works.