JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Lucas Bryce
PRO
Lucas Bryce
Pro Student 4,510 Points

WHY DOES IT NOT WORK

PLEASE HELP ME THANKS

index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <button type="submit" class="submit-btn">Submit If You Can</button>

    <script
    src="jquery-3.2.1.min.js"></script>
    <script src="app.js"></script>
</body>
</html>
app.js
const $submit = $('.submit-btn');
$submit.attr('disabled', true);

$submit.addClass("disabled");

1 Answer

Steven Parker
Steven Parker
182,492 Points

The instructions say to "Chain the appropriate jQuery method to add the class of disabled to the submit button."

You've called the correct method, but you did it in a separate statement. Re-write it using method chaining to make it part of the same statement that sets the attribute.