Last active
May 3, 2016 19:45
-
-
Save albertomm/594fa727096f13f156bd7a3ef0ac2f21 to your computer and use it in GitHub Desktop.
JQuery Cheat Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Selectors */ | |
$("button"); // by tag name | |
$(".animated"); // by class name | |
$("#button3"); // by ID | |
$("someselector:nth-child(2)"); | |
/* CSS */ | |
$(selector).addClass("someclass"); | |
$(selector).removeClass("someclass"); | |
$(selector).css("color", "blue"); | |
/* HTML */ | |
$(selector).prop("disabled", true); | |
$(selector).text("Hello World."); | |
$(selector).html("Hello <em>World</em>."); | |
$(selector).remove(); // remove selection | |
$(selector).clone(); // get a copy of the selected element | |
$(selector).appendTo(selector); // move selection inside another element | |
$(selector).parent(); | |
$(selector).children(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment