Web Programming - Week 4 Flashcards
What is the window object
The global object of JavaScript in the browser
What are the three kinds of popup boxes in JavaScript
window. alert - Displays alert with content and OK button
window. prompt - For text input
window. confirm - To verify or accept something
What is the purpose of jQuery
To make it much easier to use JavaScript on the website
Advantages of jQuery code
Allows less code to be written
Allows reusability with different JavaScript code
Write document.getElementsById(“myheader”) in jQuery notation
$(“myHeader”)
Write document.getElementsByClassName(“divClass”)
$(“.divClass”)
Write code that accesses all < p > elements with id “intro”
$(“p.intro”)
How to access the jQuery library
< script src=”jquery-3.5.1.min.js >< /script > in the head tag
JQuery Syntax
$(selector).action()
What is the method to run code when a website is finished loading
The (document).ready() method
What is the p.toggle method
Toggle(ms) shows or hides a paragraph
The jQuery CSS method
$(“div”).css ({property : value, property : value, etc…});
jQuery filtering methods
first()
last()
eq() - returns element with a specific index
filter()
not()
JQuery class methods
addClass()
removeClass()
toggleClass()
Most common jQuery Mouse events
click()
dblclick()
mouseenter()
mouseleave()