How to make a code only work for desktop version of a website

Hi, my website has some buttons that appear on hover. However on the mobile version ‘hover’ doesn’t happen so the buttons remain invisible.
Is there a way to disable codes for the mobile version? -this way the buttons won’t disappear in the first place, which is what I want-
(quite urgent)

thank u

import wixWindow from "wix-window";
$w.onReady(() => {
if(wixWindow.formFactor === "Desktop"){
//code for desktop
} else {
//code for tablet and mobile
}
//common code
})

Worked perfectly, thank you v much

You’re welcome :slight_smile: