Cheatsheet

var $AllElements = $("*");
var count = $AllElements.css("border", "3px solid red").length;

var $Body = $("body");
$Body.prepend("<h3>New Heading</h3>");

var $ElementsWithMyClass = $(".myClass");
var $DivElements = $("div");
var $ElementById = $("#MyId");
var $ElementByAttribute = $("div[data-test]"); // Elements that have the attribute.
var $ElementByAttributeValue = $("div[data-test='Value']"); // Have the attribute with designated value.

$("div,span,p.myClass").css("border", "3px solid red"); // Spaces between selectors are ignored.

// Selects all direct child elements specified by "child" of elements specified by "parent".
$("ul.topnav > li").css("border", "3px double red" );

// Selects all elements that are descendants of a given ancestor.
$("form input").css("border", "2px dotted blue");

// Selects all next elements matching "next" that are immediately preceded by a sibling "prev".
$("label + input").css("color", "blue").val("Labeled!");

// Selects all sibling elements that follow after the "prev" element,
// have the same parent, and match the filtering "siblings" selector.
$("#prev ~ div").css("border", "3px groove blue");