JS & JQuery Flashcards
Adds HTML elements to the end of the selected element
$( ).appendTo()
Adds HTML elements to the beginning of the selected element
$( ).prependTo()
Removes the selected HTML element from the web page
$( ).remove()
Hides the selected HTML element
$( ).hide()
Displays the element
$( ).show()
Alternates hiding and showing the element
$( ).toggle()
Adds a CSS class to an element
$( ).addClass()
Removes a CSS class from an element
$( ).removeClass()
Alternates adding and removing class from an element
$( ).toggleClass()
Method that gets next sibling of selected element
.next()
Method that gets the previous sibling of the selected element
.prev()
Method that gets all the children of the selected element
.children()
How to load a function once the html document is ready
$(document).ready(main);
How to grab form inputs (like grabbing text from a <p> elem)</p>
.val()
Method shows selected HTML element by sliding it down / up
.slideDown() / .slideUp()