icon for lab

CT310

Recitation 10 - jQuery

In this recitation, we will:


Make sure to submit the link to your lab on Canvas under lab 10 to get credit for today

A lightweight JavaScript library: "write less, do more"

Simpliflies many complex JS tasks

But does the same things!

It is referenced using the source: "jquery-3.3.1.min.js

$(selector).action()

This is a function that changes the text of the "bar" element to "hello". The HTML button would need to be given the onclick attribute.

This gives the element with id "btn" an EventListener for onclick that changes the "bar" element's text to "hello".

Click here to reach another example

Check out the W3 schools for help, also check out the jQuery animations.

  1. Download the tar file here
  2. Button1: add the center header class to header tag
  3. Button2: clicking this button hides the image.
  4. Button3: clicking this button reveals the image.
  5. Button4: clicking this button slides the part2 div shut.
  6. Button5: clicking this button slides the part2 div open.
  7. Button6: clicking this button slideToggles the image.