jQuery Flashcards
What is the first thing I must add to HTML in order to start using jQuery?
Script element (document ready function) at the top of page
What is the jQuery Script element code that I must place at the top of a HTML in order to use jQuery?
$(document).ready(function(){
});
All jQuery functions start with what?
a “$”
What 2 names is a “$” referred to as when using jQuery?
- dollar sign operator
2. bling
jQuery often selects an HTML element with a _____, then does something to that element.
selector
How would I use jQuery to make all HTML button elements bounce?
Add the code below inside the Document Ready Function at the top of the HTML.
$(“button”).addClass(“animated bounce”);
What does $(“button”) tell the computer?
To select all of the HTML buttons
What does .addClass(“animated bounce”); tell the computer?
It is using jQuery language to tell the computer to add some CSS classes to what has been selected previously.
How would I use jQuery to target HTML (div) elements with a CSS class of (well)?
by using the $(“.well”) selector.
Why is there a period contained within the jQuery target $(“.well”)?
Because jQuery uses the period before a CSS class name just like one would with CSS.
What does $(“.well”).addClass(“animated shake”); tell my computer
To select the HTML elements that have the CSS “well” class and add Animated CSS’s animated and shake to them.
What are three ways that jQuery can HTML target elements?
- By their CSS ID Attributes: $(“.btn”)
- By their CSS Class Attributes: $(“#target1”)
- By their HTML Element type: $(“button”)
What does $(“#target3”).addClass(“animated fadeOut”); tell my computer?
To target the HTML elements that have the CSS ID of target3 and add CSS Class of Animated / Fade Out
What jQuery function tells my computer to remove assigned CSS classes to an HTML element?
The (.removeClass) function
We can also _____ the CSS of an HTML element directly with jQuery.
change