jQuery Flashcards
all jQuery functions start with …
$
add classes to elements
.addClass() function
select CSS class
.class
select CSS id
id
select type
html element
remove class from elements
.removeClass() function
change the CSS of an element with…
.css()
.css(“color”,”blue”);
adjust the properties of elements (non-CSS)
.prop()
.prop(‘disabled’, true)
add HTML tags and text within an element
.html()
$(“h3”).html(“<em>jQuery Playground</em>”);
.text() and what it does
only alters text without adding tags, otherwise similar to .HTML()
will not evaluate any HTML tags passed to it, but will instead treat it as the text you want to replace the existing content with.
remove an HTML element entirely
.remove()
select HTML elements and append them to another element
.appendTo(“#id”)
make a copy of the element
.clone()
access the parent of whichever element
.parent()
access the children of whatever element
.children()