JavaScript jQuery Basics Working with jQuery Collections Adding/Removing Classes

Seth Pabst
Seth Pabst
8,608 Points

What's wrong with my code I can't figure this out??

It says strict mode won't allow implicit creation of global property '$submit'

<!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>
$submit = $('.submit-btn');
$submit.attr('disabled', true);

1 Answer

Implicit creation of global property '$submit' means the variable $submit wasn't declared. You need to use const or var to do so. See this video @ 3:49 for an example.