freeCodeCamp Challenge Guide: Target HTML Elements with Selectors Using jQuery

freeCodeCamp Challenge Guide: Target HTML Elements with Selectors Using jQuery
0

#1

After we have created our document ready function we can now have code that will run after the page loads. This will assure that your code does not run before the HTML is rendered to avoid bugs.

jQuery often selects an HTML element with a selector, then does something to that element.

The following code will make the buttons have a bouncy animation on page load.

DON’T FORGET TO PAY ATTENTION TO CAPITAL LETTERS WHILE WRITING THE FUNCTION!!!

<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>

#2

For the love of god make sure you add capital letters when you’re supposed to. It will save you much pain. Not that i’d know…


#3

Also be aware to put a space between animated and bounce.