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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Marni Ali](https://uploads.teamtreehouse.com/production/profile-photos/11684944/micro_DC620C10-18D6-4402-B769-1B72C1874FAE__1_.jpg)
Marni Ali
4,642 PointsProblems in changing the content of the element in jQuery
Hi there, I need help to take a look at my code. I can't seem to get it right. When I did a preview, it works fine. Thank you in advance.
This is was my code challenge: 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>
jQuery('.profile-text');
const contents = "I am web developer";
$('.profile-text').html(contents);
2 Answers
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsHi Marni. While your code would work these challenges can be very picky. First of all remove your const contents and paste the string directly in the html(). And second and the one that took me a few minutes to find was in the string you are missing 'a'. It should be "I am a web developer". Keep at it! These challenges are picky but help you be more exact and improve your debugging skills.
![Marni Ali](https://uploads.teamtreehouse.com/production/profile-photos/11684944/micro_DC620C10-18D6-4402-B769-1B72C1874FAE__1_.jpg)
Marni Ali
4,642 PointsHi Mark, Thank you for your help and reply. I did what you suggested by removing and pasting. But the same error still appears.
jQuery('.profile-text');
const contents = "I am a web developer";
$('.profile-text').html(contents);
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsMove your string into the HTML. Don’t use the const contents.
$('.profile-text').html(“I am a web developer”);