Featured image of post JQuery Cheatsheet

JQuery Cheatsheet

JQuery Cheatsheet

jQuery Cheatsheet

ConceptSyntax/ExampleDescription
Selecting Elements$('#id')Selects an element by its ID
$('.class')Selects elements with a specific class
$('element')Selects all elements of a specific type
Manipulating Elements$('#element').text('Hello World!');Changes the text content of an element
$('#element').html('<p>Hello World!</p>');Changes the HTML content of an element
Event Handling$('#button').click(() => { alert('Clicked'); });Adds a click event listener to a button
Animations$('#element').fadeIn();Fades in an element
$('#element').fadeOut();Fades out an element
AJAX$.ajax({ url: 'https://api.example.com/data', success: (response) => { console.log(response); } });Makes an AJAX request
Effects$('#element').slideUp();Slides up an element
$('#element').slideDown();Slides down an element