JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Michael Slattery
PRO
Michael Slattery
Pro Student 4,146 Points

select the submit button and save to$submit

Where is the answer code to the challenges?

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

1 Answer

Sam Gord
Sam Gord
14,059 Points

-selecting by type

var $submit  = $('button[type="submit"]');

OR -selecting by class

var $submit = $('.submit-btn');