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 trialJack Cummins
17,417 PointsPlease Help Me With This Code Challange P.S. I give out best answers
Challenge Task 2 of 3
You've just learned how to use the jQuery methods text() and html(). Use the appropriate jQuery method to set the contents of the $('.profile-text') element to "I am a web developer".
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h1 class="profile-header"></h1>
<p class="profile-text"></p>
<script
src="jquery-3.2.1.min.js"></script>
<script src="app.js"></script>
</body>
</html>
$(".profile-text").text("I am a Web Developer");
4 Answers
Connor Walker
17,985 PointsThe only reason you are getting the error is because treehouse is being picky about the capitalisation inside the string used in the text() method. Just make the W in web and D in developer lowercase and it will pass, like this:
$(".profile-text").text("I am a web developer");
Patrick Vass
7,621 PointsI tried multiple versions including this one and it still throws up an error that task one is no longer passing but it is. Please some advice on the matter?
Connor Walker
17,985 PointsIf it is saying that task one is failing that is usually a sign off a syntax error. Can i have a snippet of your code to look at?
charles phiri
13,268 Pointsi'm having the same challenge as yours Patrick Vass
Patrick Vass
7,621 PointsThanks Connor Walker for pointing out the obvious, I checked again and it was a syntax error and I passed the challenge
Madyson Taylor
Front End Web Development Techdegree Student 13,255 PointsCould you please show me what you did. I got thru the first part but for the second half I have hit a wall... Please help!
Steven Rweyemamu
9,881 Pointsyou got to comment out line 2 and it should look like this
jQuery(".profile-header"); //jQuery(".profile-text");
$('.profile-text').text("I am a web developer");
Jack Cummins
17,417 PointsJack Cummins
17,417 PointsThank you so much!
Sam Allen
7,176 PointsSam Allen
7,176 PointsIt's very peculiar that Treehouse won't accept this yet the preceding exercise recommended this format as best practice: