Hidden Elements in Mobile View

I have tried to hide an element in the mobile view using the steps in this tutorial
https://support.wix.com/en/article/corvid-tutorial-displaying-elements-in-mobile-only#api-list457868

Unfortunately, it doesn’t seem to work for my case, even though I have made the element hidden on load.

There was an error in the code that says something like my element was an invalid selector or something.

What could the problem be here? I have tried various types of elements ranging from a simple text to an image, the code doesn’t seem to run and show only on Mobile View.

The error you received says that you are trying to access components in the code that are hidden in the mobile. Make sure that the commands in the code you have entered that relate to items that you have hidden on Mobile are under the condition of NOT Mobile View.

Post your code for accurate help

I don’t quite understand. apologies… but here is the code

import wixWindow from ‘wix-window’;

$w.onReady(function () {
if(wixWindow.formFactor === “Mobile”){
$w(“#text36”).show();
}

});

assuming “#text36” is the element on the desktop site view which has been set to Hidden on Load.

What should I do in order to Hide this element on desktop BUT Show only when in Mobile view?

Purpose of this is that, I’m tidying up the mobile view to show a text to refer people to view the desktop site instead.

I checked the code and everything works fine. Do you get any error? Because then it will not load the code and display the item

ok thanks. i will give it a try again and see if it works…
probably it’s just me, as I am relatively new to using Wix.