attr not asynchronous. This is a very simple operation that is effective instantly.
However, downloading images from the server takes a lot of time. This process is asynchronous: once you set the attribute, you can forget about it, and the browser will download the image for you in the background.
Downloading images asynchronously is not an option: this is actually the only way to download images.
source share