Example

Change the text of a div element when an image is loaded:

$("img").load(function(){
  $("div").text("Image loaded");
});

Try it yourself »

Definition and Usage

The load() event occurs when a specified element (and sub elements) has been loaded.

This event works with any element with an URL (like image, script, frame, iframe).

Depending on the browser, the load event may not trigger if the image is cached (Firefox and IE).

Note: There is also a jQuery Ajax method called load. Which one is called, depends on the parameters.

Syntax

$(selector).load(function)

Parameter Description
function Required. Specifies the function to run when the specified element is done loading.