Home > Article > Backend Development > javascript - Ask a question about jquery.lazyload
We know that to use jquery.lazyload, you need to put the image path in data-original
So, my website has been established for several months, and it seems to be quite troublesome to modify it one by one.
Is there any way to directly modify the img tag of the website? For example, use jquery or something like that
I hope someone can solve it
We know that to use jquery.lazyload, you need to put the image path in data-original
So, my website has been established for several months, and it seems to be quite troublesome to modify it one by one.
Is there any way to directly modify the img tag of the website? For example, use jquery or something like that
I hope someone can solve it
<code>let imgs = $("img"); imgs.each(function() { let src = $(this).attr('src'); $(this).attr('data-original',src); })</code>