# How to hide unneeded element in mobile page without affecting the code

**URL:** <https://forum.wixstudio.com/t/how-to-hide-unneeded-element-in-mobile-page-without-affecting-the-code/31630>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [October 15, 2020, 4:37pm UTC](https://forum.wixstudio.com/t/how-to-hide-unneeded-element-in-mobile-page-without-affecting-the-code/31630 "2020-10-15T16:37:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![orhirschhorn14](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/orhirschhorn14/32/23213_2.png) [@orhirschhorn14](https://forum.wixstudio.com/u/orhirschhorn14)\
**Post date:** [October 15, 2020, 4:37pm UTC](https://forum.wixstudio.com/t/how-to-hide-unneeded-element-in-mobile-page-without-affecting-the-code/31630/1 "2020-10-15T16:37:57Z")

</div>

i have elements in desktop version that unneeded in mobile version, those elements are used in the code.  
What is the best way to hide them without affecting and destroying the code?  
The code cannot compile after hiding this elements from mobile version editor because it removes them from the DOM.

Thanks

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [October 15, 2020, 5:31pm UTC](https://forum.wixstudio.com/t/how-to-hide-unneeded-element-in-mobile-page-without-affecting-the-code/31630/2 "2020-10-15T17:31:34Z")

</div>

Remove them from the mobile view, and limit the specific chuck of code to desktop only:

```javascript
import wixWindow from 'wix-window';
$w.onReady(() => {
if(wixWindow.formFactor === "Desktop"){
//code for desktop
}
})

```
