Sets the width and height of all images on the page based on their src attribute.
The src attribute should contain width and/or height values in the format "width=100" or "height=100".
If jQuery is available, this function uses jQuery to select the images. Otherwise, it uses pure JavaScript.
Usage:
// Example images with `src` attributes containing `width` and/or `height` values constimg1 = document.createElement("img"); img1.setAttribute("src", "https://example.com/example.png?width=2233&height=111"); document.body.appendChild(img1);
Sets the width and height of all images on the page based on their
src
attribute. Thesrc
attribute should containwidth
and/orheight
values in the format "width=100" or "height=100". If jQuery is available, this function uses jQuery to select the images. Otherwise, it uses pure JavaScript.Usage: