JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<img src="#" width="300" />
<img src="#" width="100" />
<img src="#" width="200" />
</body>
</html>
JavaScript
var images = $('img');
if ( images.length ) {
// images were found
images.sort( function (img1, img2) { return img1.width-img2.width } );
}
console.log(images);