JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

JQuery Adding/Removing classes

Challenge Task 2 of 2

The submit button is now disabled, but it doesn’t look like it! Luckily, we have a class called disabled in our CSS that will n.

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

    <script src="app.js"></script>
const $submit = $('.submit-btn').addClass(disabled); 

2 Answers

Antti Lylander
Antti Lylander
9,660 Points

You are chaining on the wrong line and missing quotes.

const $submit = $('.submit-btn') $submit.attr.("disabled",true).addClass("disabled");