jQuery load() Method

jQuery load() method is used to attaches event handler to the load event. The jQuery load event occurs when a specified element has been loaded. And when the load event occurs, specified function will execute.

The load() method was deprecated in jQuery 1.8. and removed om jQuery 3.0.


This syntax represent to the load() method

Parameter Type Description
function Function Optional. Specifies the function to execute when the event is occurs


This example represent the load event, it will attaches event handler to the load event on the selected elements.

<!DOCTYPE html>
  <title>jQuery load() method</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
        $("div").text("This text comes, when load event triggered on selected element.");
    <img src="../../images/img_nat.png" width="207" height="137" />
    <div>Image is loading...</div>

Run it...   »