jQuery Flashcards

1
Q

What is the first thing I must add to HTML in order to start using jQuery?

A

Script element (document ready function) at the top of page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the jQuery Script element code that I must place at the top of a HTML in order to use jQuery?

A

$(document).ready(function(){

});

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

All jQuery functions start with what?

A

a “$”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What 2 names is a “$” referred to as when using jQuery?

A
  1. dollar sign operator

2. bling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

selector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would I use jQuery to make all HTML button elements bounce?

A

Add the code below inside the Document Ready Function at the top of the HTML.

$(“button”).addClass(“animated bounce”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does $(“button”) tell the computer?

A

To select all of the HTML buttons

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does .addClass(“animated bounce”); tell the computer?

A

It is using jQuery language to tell the computer to add some CSS classes to what has been selected previously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would I use jQuery to target HTML (div) elements with a CSS class of (well)?

A

by using the $(“.well”) selector.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is there a period contained within the jQuery target $(“.well”)?

A

Because jQuery uses the period before a CSS class name just like one would with CSS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does $(“.well”).addClass(“animated shake”); tell my computer

A

To select the HTML elements that have the CSS “well” class and add Animated CSS’s animated and shake to them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are three ways that jQuery can HTML target elements?

A
  1. By their CSS ID Attributes: $(“.btn”)
  2. By their CSS Class Attributes: $(“#target1”)
  3. By their HTML Element type: $(“button”)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does $(“#target3”).addClass(“animated fadeOut”); tell my computer?

A

To target the HTML elements that have the CSS ID of target3 and add CSS Class of Animated / Fade Out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What jQuery function tells my computer to remove assigned CSS classes to an HTML element?

A

The (.removeClass) function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

We can also _____ the CSS of an HTML element directly with jQuery.

A

change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

jQuery has a function called _____ that allows you to change the CSS of an HTML element.

A

.css()

17
Q

How would I use jQuery to change the CSS color of a HTML element to blue?

A

$(“#target1”).css(“color”, “blue”);

18
Q

What is the difference between a normal CSS declaration and a jQuery CSS declaration?

A

The normal CSS declaration is in quotes and seperated by a colon.

The jQuery CSS declaration shows the CSS property and CSS value in separate quotes and separated with a comma.

Example: .css(“color”, “blue”);

19
Q

T/F

One cannot change the non-CSS properties of HTML elements using jQuery?

A

False

20
Q

What jQuery function allows one to adjust the properties of HTML elements?

A

.prop()