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 trialBala Selvam
Python Development Techdegree Student 30,590 PointsYou've just learned how to use the jQuery methods text() and html(). Use the appropriate jQuery method to select the h1
No even sure on what to do here
<!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-header").text("Student <span>Profile</span>");
jQuery(".profile-text").text("I am a web developer");
2 Answers
David Evans
10,490 PointsHi again Bala,
Like your other question here: https://teamtreehouse.com/community/youve-just-learned-how-to-use-the-jquery-methods-text-and-html-use-the-appropriate-jquery-method-to-set-the-conten
They now want you to select the <h1> tag and use the other method that you chose not to use in the 2nd part of the challenge.
To change the markup inside of the selected element you would use .html(). To change just the text you would use .text().
george NGOWI
Courses Plus Student 7,499 PointsThis works for me
$(".profile-text").text("I am a web developer"); $(".profile-header").html("Sudent <span>Profile</span>");
Unsubscribed User
11,649 PointsIt is correct, but dont forget to check all frases. The work "Student" was misspelled.
So, the correct code is: $(".profile-text").text("I am a web developer"); $(".profile-header").html("Student <span>Profile</span>");
have a good luck.