JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Van Jordan
Van Jordan
3,350 Points

Clueless

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

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

1 Answer

Saqib Ishfaq
Saqib Ishfaq
13,911 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.