if (window.matchMedia('(min-width: 768px)').matches) { $(".watch-btn").insertBefore(".slide-wrap"); }