Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
22 Cards in this Set
- Front
- Back
Write the JQuery method to get the element with id="header"
|
$("#header")
|
|
Write the JQuery method to get all <h3> element
|
$("h3")
|
|
Write the JQuery method to get all element with class="photo" nested in the <div id="content">
|
$("div#content .photo")
|
|
Write the JQuery method to get all <li> element nested in all <ul>
|
$("ul li")
|
|
Write the JQuery method to get only the first <li> element of the <ul>
|
$("ul li:first")
|
|
How do you make a function be executed after the page is loaded?
|
$(document).ready(function(){
}); |
|
What is this? $()
|
The JQuery constructor
|
|
How do you add a CSS class to an element?
|
$('#someID').addClass('nameOfClass');
|
|
How do you remove a CSS class to an element?
|
$('#someID').removeClass('nameOfClass');
|
|
Can you have more than one CSS class on an element?
|
Yes.
|
|
What is a callback function?
|
A function passed as a argument of another function and is executed after the parent function completes.
|
|
How do you pass a callback function with no parameters?
|
parentFunct('somevar', myFunc)
|
|
How do you pass a callback function with parameters?
|
parentFunct('somevar', function(){ myFunc(param1, param2) })
|
|
How do you use the prototype property?
|
var form = $("#myform");
form.clearForm; // undefined form.fn.clearForm = function() { return this.find(":input").each(function() { this.value = ""; }).end(); }; form.clearForm() // works for all instances of jQuery objects, because the new method was added to the prototype |
|
How do you get the css atrributes of a element?
|
$('element').css('attribute');
|
|
How do you set the css attributes of a element?
|
$('element').css('atrribute', 'newprop')
|
|
How do you get the value of an input field with id="name"
|
var name = $("input#name").val();
|
|
What option tells the ajax method that the data that will be returned is json?
|
dataType: 'json'
|
|
What function waits until the document and DOM is loaded before executing?
|
1.
$(document).ready(function() { 2. // put all your jQuery goodness in here. 3. }); |
|
How do you set the innerHTML of a element?
|
$('element').html('new html here');
|
|
In a javascript function, I pass in a element. Use jquery to find a child of that element with name = 'comment'
|
$(element).find('[name=comment]')
|
|
If find(expr) finds all the children matching the expr? what finds all the parents matching the expr?
|
parents(expr)
|