How to adjust size of all images to 400*300 in a html file keeping following conditions ?
In other words, I am finding a javascript (blahblah part) of a form
<script>
...
blahblah
...
</script>
<img src="image/01.jpg">
<img src="image/02.jpg">
...
<img src="image/99.jpg">
which will get the same effect as following
<img src="image/01.jpg" width=400 height=300>
<img src="image/02.jpg" width=400 height=300>
...
<img src="image/99.jpg" width=400 height=300>
window.addEventListener('DOMContentLoaded', (event) => document.querySelectorAll('img').forEach((img) => ([img.width, img.height] = [400, 300])), false);