Skip to content
Justice Tech School

jQuery Exercises

Fill in the blanks to check your knowledge. Each exercise belongs to a lesson.

jQuery Introduction

Exercise

Which symbol is the jQuery shortcut?

The shortcut is ('p')

jQuery Get Started

Exercise

Add the library with a ___ tag.

< src="jquery.js"></script>

jQuery Syntax

Exercise

Pick the action.

$('p').()

The Document Ready Event

Exercise

Ready event.

$(document).(fn)

jQuery versus Plain JavaScript

Exercise

Vanilla selector method.

document.('.card')

Method Chaining

Exercise

Chain with a ___.

$('p').hide()show()

Basic Selectors

Exercise

Select by id.

$('main')

Combining Selectors

Exercise

Select direct children.

$('ul  li')

Filter Selectors

Exercise

First element.

$('li').()

Attribute and Form Selectors

Exercise

Checked boxes.

$('input:')

The this Keyword

Exercise

Wrap the element.

$()

Selector Performance

Exercise

Cache name starts with ___.

const items = $('.item')

Click and Mouse Events

Exercise

Mouse enters.

$('p').(fn)

Keyboard and Form Events

Exercise

Stop the form sending.

e.()

The on() Method

Exercise

Remove a handler.

$('#btn').('click')

Event Delegation

Exercise

Parent handler selector.

$('#list').on('click', '', fn)

The Event Object

Exercise

Stop bubbling.

e.()

Triggering and Custom Events

Exercise

Fire an event.

$('#b').('click')

Hide, Show and Toggle

Exercise

Switch visibility.

$('p').()

Fading

Exercise

Fade to half.

fadeTo(300, )

Sliding

Exercise

Slide closed.

$('#p').()

Custom Animations

Exercise

Animate method.

$('#box').({ left: 200 })

Stop, Delay and Queue

Exercise

Pause the queue.

$('#b').(500)

Prefer CSS for Simple Effects

Exercise

Toggle a class.

$('#b').Class('hidden')

Get and Set Content

Exercise

Read an input value.

$('#name').()

Attributes and Properties

Exercise

Property for a checkbox.

$('#c').('checked', true)

Add Elements

Exercise

Add at the start.

$('ul').('<li>1</li>')

Remove Elements

Exercise

Clear children.

$('#list').()

Working with Classes

Exercise

Check a class.

$('#a').('on')

The css() Method

Exercise

Set several properties.

$('p').css()

Dimensions and Position

Exercise

Include padding.

$('#b').Width()

Clone, Wrap and Replace

Exercise

Copy an element.

$('#r').()

Parents and Children

Exercise

Nearest matching ancestor.

$('b').('.card')

Siblings

Exercise

Next element.

$('h2').()

Filtering

Exercise

Exclude matches.

$('li').('.off')

Looping with each

Exercise

Loop helper.

$('li').(fn)

find versus children

Exercise

Search all descendants.

$card.('.title')

Parent Methods

Exercise

Nearest ancestor.

$("li").("div")

Children and Find

Exercise

Search any depth.

$("div").("a")

Siblings

Exercise

Next element.

$("li").()

filter, not, first, last, eq

Exercise

Third item.

$("li").(2)

each Loop

Exercise

Loop.

$("li").(function () {})

map, is and has

Exercise

Test a condition.

$("li").(".on")

Chaining

Exercise

Chain calls.

$("#b").a()b()

length and index

Exercise

Count matches.

$("li").

add, end and andSelf

Exercise

Combine sets.

$("h1").("h2")

AJAX Introduction

Exercise

Request method.

method: ''

get and post

Exercise

Send data.

$.('/api', data)

The load() Method

Exercise

Load into an element.

$('#box').('/page')

JSON Data

Exercise

JSON helper.

$.JSON(url)

Promises and Deferreds

Exercise

Always runs.

$.get(u).(fn)

Submitting Forms with AJAX

Exercise

Turn fields into a string.

$(this).()

Writing a Plugin

Premium exercise. See plans

extend and Options

Premium exercise. See plans

The data() Store

Premium exercise. See plans

Deferred Objects

Premium exercise. See plans

Event Namespaces

Premium exercise. See plans

jQuery UI

Premium exercise. See plans

Custom Selectors and Filters

Premium exercise. See plans

Global AJAX Setup and Errors

Premium exercise. See plans

CORS, JSONP and Security

Premium exercise. See plans

Chaining Requests

Premium exercise. See plans

Upgrading and jQuery Migrate

Premium exercise. See plans

Build an Accordion

Premium exercise. See plans

Build Tabs

Premium exercise. See plans

Form Validation

Premium exercise. See plans

Live Search Filter

Premium exercise. See plans

Build a Modal

Premium exercise. See plans

Infinite Scroll and Lazy Loading

Premium exercise. See plans

Debugging jQuery

Premium exercise. See plans

Performance Tips

Premium exercise. See plans

Moving from jQuery to Vanilla JS

Premium exercise. See plans

jQuery Best Practices

Premium exercise. See plans

Document Ready

Exercise

Ready event.

$(document).(fn);

Basic Selectors

Exercise

Id selector.

$("title")

Selector Filters

Exercise

Skip a class.

$("p:(.skip)")

text, html and val

Exercise

Read input value.

$("#n").()

attr and prop

Exercise

Set a property.

$("i").("checked", true)

css Method

Exercise

Set a style.

$("p").("color", "red")

Classes

Exercise

Toggle.

$("#b").Class("a")

Width and Height

Exercise

Include padding.

$("b").Width()

Adding Content

Exercise

Add to the end.

$("ul").("<li>x</li>")

Removing Content

Exercise

Clear children.

$("ul").()

Cloning

Exercise

Copy with events.

$("#r").clone()

Wrapping Elements

Exercise

Wrap each.

$("p").("<div></div>")

show, hide and toggle

Exercise

Hide.

$("#a").()

Fading

Exercise

Half opacity.

$("a").fadeTo(300, )

Sliding

Exercise

Slide closed.

$("p").()

animate

Exercise

Duration.

$("b").animate({ left: 5 }, )

stop and delay

Exercise

Pause.

$("a").(500)

Animation Queue

Exercise

Order.

Animations run in 

Effect Callbacks

Exercise

After finishing.

fadeOut(300, )

CSS vs jQuery Animation

Exercise

Toggle class.

$("m").toggle("open")

click Events

Exercise

Click handler.

$("b").(fn)

on and off

Exercise

Remove handler.

$("a").("click")

The Event Object

Exercise

Stop default.

e.()

Event Delegation

Exercise

Delegate to li.

$("#l").on("click", "", fn)

Keyboard Events

Exercise

Key name.

e. === "Enter"

Form Events

Exercise

Serialize.

$("f").()

focus and blur

Exercise

Lose focus.

.on("", fn)

trigger and custom events

Exercise

Fire it.

$("a").("saved")

Simple Form Validation

Exercise

Trim.

$("#e").val().()

Mouse Events

Exercise

Mouse enters.

.on("mouse", fn)

load

Exercise

Load into.

$("#b").("/x.html")

get and post

Exercise

POST.

$.("/api", data)

$.ajax

Exercise

Failure handler.

.(function () {})

getJSON

Exercise

JSON shortcut.

$.JSON(url, fn)

Promises and Deferred

Exercise

Wait for many.

$.(a, b)

Utility Functions

Exercise

Merge objects.

$.({}, a, b)

noConflict

Exercise

Release dollar.

jQuery.()

data Method

Exercise

Store data.

$("a").("k", 1)

Storage and Cookies

Exercise

Read saved.

localStorage.("name")

Writing a Plugin

Exercise

Extend.

$..highlight = fn

jQuery UI Intro

Exercise

Widget.

$("d").()

Project: Accordion

Exercise

Next panel.

$(this).().slideToggle()

Project: Tabs

Exercise

Show target.

$(href).()

Project: Modal

Exercise

Open.

$("o").(200)

Project: Todo List

Exercise

Escape text.

$("<i>").text(t).()

Project: Live Filter

Exercise

Show or hide.

$(this).(cond)

Performance Tips

Exercise

Cache.

var items = $("li");

jQuery and Vanilla JS

Exercise

Modern select.

document.All("p")

Project: Image Slider

Exercise

Wrap around.

(i + 1)  imgs.length

Project: AJAX Form

Exercise

Send form data.

$.post(url, $(this).())

Debugging jQuery

Exercise

Is it found?

console.log($("x").)

Next Steps

Exercise

Docs site.

.jquery.com