No jQuery, just JavaScript. I'm using prototype.js but can't find in documentation how can I do that.
I have the img element, and some event that change attr src, so my code is:
document.getElementById('image').addEventListener('change', myFunction(), false);
but this solution doesn't work with img element!
You can't use change event for img tag.
The
changeevent is fired for<input>, <select>, and <textarea>elements when a change to the element's value is committed by the user.
So try like this whenever a image is changed, it will be loaded, so bind it using load event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With