How to define image on load js function


I want to call function on image type data type on frappe form inside js after the image is fully loaded. So, where and how to write it?

In normal html page suppose I have one image as

<img src=“img/bettlejuice.jpg” id=“img1” />

and in script I have as follows:


How, I can achieve this in frappe doctype js?