JSFiddle - React, Tailwind, and code Playground
HTML
<div class="d3-d4 m1" id="logoHolder">
<img src="http://placehold.it/350x150" />
</div>
JavaScript
$(document).ready(function () {
imgSwap();
$(window).on("resize", imgSwap);
});
function imgSwap() {
var screenWidth = $(window).width(),
$image = $("#logoHolder img");
if (screenWidth < 769) {
if ($image.hasClass("alt-img")) {
$image.attr("src", "http://placehold.it/350x150").removeClass("alt-img");
}
} else {
if (!$image.hasClass("alt-img")) {
$image.attr("src", "http://placehold.it/150x50").addClass("alt-img");
}
}
}