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 jQuery Basics Introducing jQuery Using text() and html()

Laura Pesce
seal-mask
.a{fill-rule:evenodd;}techdegree
Laura Pesce
Full Stack JavaScript Techdegree Student 7,875 Points

I am trying to pass this challenge but I always get this error: Unexpected AST node type passed to processExpressionStat

I also tried using the .text() method, but I can't figure out what's the problem

index.html
<!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>
app.js
const content = "I am a web developer";

$('.profile-text').html(content); 

1 Answer

Balazs Peak
Balazs Peak
46,160 Points

Your code would work in a real-life situation just fine, but the Treehouse challenge unit tester wants you to do exactly and only what it specified. What I mean by that is do not use variable, pass the string directly, and do as much as the description says in the 3 steps.