Title: Quiz Week 11 jQuery
Course: Fall 2023 - WEBD 164 (41934) > Section: Week 11 (Oct 30) Selectors, Methods, and Event Methods

Q: Which of the below statements are true about jQuery. Check as many as apply.
- It is a JavaScript library
- It is based on native JavaScript functions
- It enables you to write JavaScript using less code in a more understandable manner
- It incorporates browser differences
A: It is a JavaScript library; It is based on native JavaScript functions; It enables you to write JavaScript using less code in a more understandable manner; It incorporates browser differences

Q: In order to use jQuery you must have access to the jQuery library. Which of the below methods will achieve this? Click as many as apply.
- Download and install it on your computer
- Link to it from a Content Delivery Network (CDN)
- Use a special browser
- You do not need to do anything as the jQuery library is already part of the operating system
A: Download and install it on your computer; Link to it from a Content Delivery Network (CDN)

Q: Which of the following is true about the "ready" function or event? Check as many as apply.
- It waits until the HTML page has loaded before it runs your code
- It is part of, or bulit into the jQuery language
- It uses an "anonymous" function
- It runs your code as soon as the page begins to load, not after the page has loaded
A: It waits until the HTML page has loaded before it runs your code; It is part of, or bulit into the jQuery language; It uses an "anonymous" function

Q: jQuery allows us to interact with the elements on the Web page by using CSS selectors
- True
- False
A: True

Q: If I wanted to manipulate the below HTML element, and only that element, which of the following jQuery expressions would I use

<h1 id=”firstHeading”></h1>
- $(“firstHeading”)
- $(“#firstHeading”)
- $(“h1”)
- $(“id=firstHeading”)
A: $(“#firstHeading”)

Q: If I wanted to write - Hello World - to the web page using the below HTML code, which jQuery statement would be the correct one to use?

<h1 id="mainhead"></h1>
- $(‘#mainhead’).html(“Hello World”);
- $(‘#mainhead’).write(“Hello World”);
- $(‘#mainhead’).output(“Hello World”);
- $(‘#mainhead’).function(“Hello World”);
A: $(‘#mainhead’).html(“Hello World”);