Manipulating the DOM
Changing HTML Content
$("#demo").html("Hello, jQuery!");
Changing Attributes
$("#myLink").attr("href", "https://example.com");
Adding and Removing Classes
$("#box").addClass("highlight"); $("#box").removeClass("highlight");
Appending and Prepending Elements
$("#list").append("<li>New Item</li>"); $("#list").prepend("<li>First Item</li>");
Removing Elements
$("#element").remove(); $("#element").empty(); // Removes content but keeps the element