I am trying to replace HTML content in small screen size and then replace it when the window is made larger again. My code below works but how do i get it to remove the change?
Here is my code so far:
$(window).resize(function() {
if (window.innerWidth < 480) {
$('.LatestNews').replaceWith('<h3><a href="">News Link</a></h3>');
} else if (window.innerWidth > 480) {
// Change back to original .LatestNews
}
}).resize();
Thanks.