$("#box").css("color", "red").slideUp(1000).slideDown(1000);
$.when($.ajax("https://api.example.com/data"), $.ajax("https://api.example.com/info")) .done(function(response1, response2) { console.log("Both requests completed successfully"); }) .fail(function() { console.log("An error occurred"); });
$("#parent").on("click", "button", function() { alert("Efficient event handling!"); });
var $box = $("#box"); $box.css("background", "blue").fadeIn(500);
.data()
Instead of .attr()
for Performance$("#element").data("key", "value");