JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

what's going on my code..

why it is incorrect ?

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
var $submit =$('.submit-btn').addClass("disabled");
$submit.attr('disabled', true);

1 Answer

Adam N
Adam N
62,463 Points

Looks like the challenge wants you to do the chaining on line 2. In real life I think your way would be fine.

Let me know if this helps here