The following example demonstrates the preloading of images:
Note that the image tag does not itself handle onMouseOver() and onMouseOut() events. Hence <img> tag in the example above has been enclosed in an <a> tag, which does include support for those event types.
- Save the file as preloading.html in your system.
- Just open the file in the browser, you will notice how the image gets loaded fast.