JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Select the submit button by its class and save it to a variable called $submit. Then use the appropriate jQuery method ?

what is the ans of this question?

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').css("button", "disabled");
Kevin Lewis
Kevin Lewis
15,088 Points
const $submit = $('.submit-btn');
$submit.attr('disabled', true).addClass('disabled');

1 Answer