"Show on all pages" needs to be hidden on some pages but Wix instructions only hide on desktop

Wix tutorial suggests the solution to hide on some pages as $w("#myelement).hide(), but this only hides on desktop. When I preview in mobile, this line in the code shows an error saying “#myelement” is not a valid selector.

Can anyone help with a solution please?

thanks

You probably removed the element from the mobile editor (and therefore it doesn’t exist their and cannot hide an element that doesn’t exist.
Put it back and the you’ll be able to hide it.

i will check that now. Genius observation JD. thank you. I know I didn’t hide it, but I know sometimes the mobile editor automatically hides content that may fall outside the grid lines so I will check it. Thanks for the help