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

John Lukacs
John Lukacs
26,806 Points

Why does jquery not work for me

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>

<body>
<h1>Make it blue</h1>






<script src="../Documents/Unnamed Site 2/Delta/resocrces/js/jquery-2.2.0.min.js"></script>
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="../Documents/Unnamed Site 2/Delta/resocrces/js/javas.js"></script>
</body>
</html>

$(document).ready(function() {


$('h2').click(function(){
    $(this).css('background-color', '#ffff00');

});
});

I cannot get this h1 to change its background color what am I doing wrong

John Lukacs
John Lukacs
26,806 Points

Oh nevermind I see it

Steven Parker
Steven Parker
229,980 Points

Don't you wish you could delete questions? :laughing:

1 Answer

Codin - Codesmite
Codin - Codesmite
8,600 Points

You have h2 in your jQuery, not h1 :)