JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Van Jordan
Van Jordan
3,350 Points


I don't know what I'm doing wrong.

<!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').attr('disabled');

1 Answer

Saqib Ishfaq
Saqib Ishfaq
13,912 Points

Van Jordan if you are trying to add an attribute, then jQuery attr() method takes two arguments like this>>> .attr('disabled', 'disabled'); or can also do this>>> .attr('disabled', true);

hope this helps, let me know if you require more assistance.