ExampleIf the image element encounters an error, replace it with a predefined text:
Try it yourself » |
The error event occurs when an element encounters an error (if the element is not loaded correctly).
The error() method triggers the error event, or specifies a function to run when an error event occurs.
Tip: This method is a shortcut for bind('error', handler).
Trigger the error event for the selected elements.
|
Try it yourself » |
Specifies a function to run when the error event occurs for the selected element.
|
Try it yourself » |
Parameter | Description |
---|---|
function | Optional. Specifies the function to run when the error event occurs |