jQuery Flashcards

1
Q

DOM

A

Document Object Model - a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.

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

How to link a JavaScript script to an html file?

A

In head:

script type=’text/javascript’ src=’script.js’

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

Basic jQuery syntax

A

$(document).ready(function () {

});

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

Creating a variable

A

var $target = $(‘div ol li li’);

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

this keyword

A

affects only the element that triggered the event handler

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

Syntax: .css() [use]

A

$(“div”).css(“background-color”,”red’); [changes (/adds?)the css properties of an element]

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

.html(), .val() [uses]

A

html gets [.html()] or changes [.html(‘hi’)] the contents of a tag. val gets the contents of form elements

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

Syntax: getting a value from a form

A

var $toAdd = $(‘input[name=name_of_form]’).val();

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

.on()

A

$(document).on(‘event’,’selector’, function() {
Do stuff;
});

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

Syntax: .animate()

A

$(‘div’).animate({left:’-=50px’}, 200)

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

Syntax: taking an input for, e.g. .keydown()

A
$(document).keydown(function(key) {
        // key is the key
    })
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

jQuery UI

A

script src=”//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js” /script

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