JavaScript jQuery Basics Understanding jQuery Events and DOM Traversal Adding New Elements to the DOM

Why isnt my code working?

i dont see why this isnt working

<!DOCTYPE html>
<html lang="en">
    <h2>Student List</h2>

    <ul class="student-list">
        <li>James McAvoy</li>
        <li>Alena Holligan</li>
        <li>Wade Christensen</li>
        <li>Matt Krzyzynski</li>

    <script src="app.js"></script>
var $newStudent = $('.student-list').append("<li>Sam Smith</li>");

1 Answer

Steven Parker
Steven Parker
173,603 Points

The second task wanted you to use the variable you created in the first task, but not change what it contains.

Start with what you had at the end of task 1, and then implement task 2 as a separate step on the following line.