So, if you want to check if the size changes, then change the verification code below.
window.onresize = window.onload = function () { if (window.innerWidth < 768) { var logo = document.getElementById('changeLeft'); logo.src = "MobileImage.png"; }else{ var logo = document.getElementById('changeLeft'); logo.src = "DesktopImage.png"; } };
Adjust the window.innerWidth parameter to define breakpoints. Hope this helps.
source share