jQuery Cheat Sheet
A searchable, printable jQuery reference — selectors, DOM manipulation, events, effects, traversing, AJAX and form helpers. Free.
Selectors
14$('#id')
$('.class')
$('div')
$('*')
$('[name="email"]')
$('a[href^="https"]')
$('ul li:first')
$('ul li:last')
$('tr:eq(2)')
$('li:not(.done)')
$(':checked')
$('div:visible')
$('ul li')
$('ul > li')
Document ready & DOM
10$(function () { /* ... */ });
$(document).ready(fn)
$(window).on('load', fn)
$(this)
$(el)
$('<div class="box"></div>')
$('#box')[0]
$('#box').get(0)
$('.item').length
$('#box').is(':visible')
DOM manipulation
12$('#box').html('<b>Hi</b>')
$('#box').text('Hello')
$('#name').val('Ada')
$('#list').append('<li>x</li>')
$('#list').prepend('<li>x</li>')
$('#box').before('<hr>')
$('#box').after('<hr>')
$('#box').remove()
$('#box').empty()
$('#box').clone()
$('#box').wrap('<div>')
$('#box').replaceWith('<p>')
Attributes & CSS
13$('#img').attr('src')
$('#img').attr('alt', 'Logo')
$('#cb').prop('checked')
$('#cb').prop('checked', true)
$('#img').removeAttr('title')
$('.box').addClass('active')
$('.box').removeClass('active')
$('.box').toggleClass('open')
$('.box').hasClass('active')
$('#box').css('color', 'red')
$('#box').css({top: 0, left: 0})
$('#box').width()
$('#box').height()
Events
12$('#btn').on('click', fn)
$('#btn').off('click')
$('#btn').click(fn)
$('#form').submit(fn)
$('#sel').change(fn)
$('#in').keyup(fn)
$('#list').on('click', '.item', fn)
$('#btn').trigger('click')
$('#btn').one('click', fn)
e.preventDefault()
e.stopPropagation()
e.target
Effects & animation
12$('#box').show()
$('#box').hide()
$('#box').toggle()
$('#box').fadeIn(300)
$('#box').fadeOut(300)
$('#box').fadeTo(300, 0.5)
$('#box').slideUp()
$('#box').slideDown()
$('#box').slideToggle()
$('#box').animate({left: 100})
$('#box').stop()
$('#box').delay(500).fadeIn()
Traversing
12$('#box').find('.item')
$('#box').parent()
$('#box').parents('.row')
$('#box').closest('.row')
$('#box').children()
$('#box').siblings()
$('#box').next()
$('#box').prev()
$('.item').each(fn)
$('.item').filter('.on')
$('.item').first()
$('.item').eq(1)
AJAX
11$.ajax({url: '/api', method: 'GET'})
$.get('/api', fn)
$.post('/api', data, fn)
$.getJSON('/api.json', fn)
$('#box').load('/part.html')
$.ajax({dataType: 'json'})
$.ajax({data: {q: 'x'}})
.done(function (res) {})
.fail(function (err) {})
.always(function () {})
$.ajaxSetup({headers: {}})
Forms
10$('#form').serialize()
$('#form').serializeArray()
$('#name').val()
$('#name').val('Ada')
$(':input')
$('#cb').is(':checked')
$('#sel option:selected')
$('#in').focus()
$('#form').on('submit', fn)
$('#in').prop('disabled', true)
Utilities
11$.each(arr, fn)
$.map(arr, fn)
$.grep(arr, fn)
$.extend({}, a, b)
$.trim(' hi ')
$.inArray(2, arr)
$.isArray(x)
$.isFunction(x)
$.parseJSON(str)
$.now()
$.type(x)
No entry matches “:q”.
About jQuery Cheat Sheet
This jQuery cheat sheet is a compact reference to the library that still powers a huge share of existing sites: selectors, document ready and DOM basics, DOM manipulation, attributes and CSS, events, effects and animation, traversing, AJAX, forms, and utilities.
If you maintain legacy front-ends, plugins or older CMS themes, jQuery fluency is still a practical skill. Each row pairs a method call with a one-line description, so you can recall the exact signature for event delegation, chained traversal or an AJAX request without digging through old documentation.
The sheet is free and fully client-side. Filter methods live with the search box, jump between sections from the sticky table of contents, copy any snippet with one click and print the page when you are deep in a legacy refactor.
How to use jQuery Cheat Sheet
- Skim the sections, from Selectors and Document ready & DOM through Traversing to AJAX and Utilities.
- Search for a method like on, closest or ajax to filter the sheet live.
- Jump to a section such as Effects & animation via the sticky sidebar.
- Click a snippet or its copy icon to copy the jQuery call into your code.
- Print the sheet for offline reference while working on legacy projects.