# Using Regular JS Code - is it possible ?

**URL:** <https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [February 16, 2018, 11:47pm UTC](https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785 "2018-02-16T23:47:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atg-dax](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@atg-dax](https://forum.wixstudio.com/u/atg-dax)\
**Post date:** [February 16, 2018, 11:47pm UTC](https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785/1 "2018-02-16T23:47:28Z")

</div>

How can I run simple js code like “document.querySelector()” ?  
The js files in the public and backend folders don’t support this, and return that ‘document’ is undefined.  
Any way around this ?

Thanks!

---

<div class="post-metadata">

**Author:** ![atg-dax](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@atg-dax](https://forum.wixstudio.com/u/atg-dax)\
**Post date:** [February 18, 2018, 8:18am UTC](https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785/2 "2018-02-18T08:18:17Z")

</div>

Any one ?

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 18, 2018, 9:10am UTC](https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785/3 "2018-02-18T09:10:28Z")

</div>

Hi,

Welcome to WixCode. Glad to have you aboard.

WixCode understands all of Javascript, except for anything that accesses the DOM. Therefore, **document** is undefined in WixCode.

This keeps the user from inadvertently “breaking” something. I myself tried to hack things from the code, from an iFrame, and in my dreams, but WixCode wasn’t having any of it.

Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w. Read the [$w API reference](https://www.wix.com/code/reference/$w.html) to see what is possible (a **whole lot** is possible).

One small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc.

Good luck and have fun,.

Yisrael

---

<div class="post-metadata">

**Author:** ![Mark\_Hunte](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mark_hunte/32/100172_2.png) [@Mark\_Hunte](https://forum.wixstudio.com/u/Mark_Hunte)\
**Post date:** [August 6, 2024, 5:03pm UTC](https://forum.wixstudio.com/t/using-regular-js-code-is-it-possible/29785/4 "2024-08-06T17:03:59Z")

</div>

Hi, I know this is an old topic but I am new to six and using a free version to see if I can do the things I need to do with it.

Is this true of the paid version?  
Also what about css, does the paid version allow for you to add your own custom css files to affect the mix DOM ?

I like what I am seeing so far but I am hoping these limitations are only on the free versions and there is an advance user level in the paid where you can be trusted to know what you are doing and be responsible for breaking things.?
