# Blame the DOM?

**URL:** <https://forum.8thwall.com/t/blame-the-dom/1630>\
**Category:** Technical Support\
**Created:** [June 12, 2024, 8:53pm UTC](https://forum.8thwall.com/t/blame-the-dom/1630 "2024-06-12T20:53:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Campagna](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Campagna](https://forum.8thwall.com/u/Matthew_Campagna)\
**Post date:** [June 12, 2024, 8:53pm UTC](https://forum.8thwall.com/t/blame-the-dom/1630/1 "2024-06-12T20:53:29Z")

</div>

I’m working on a project that uses two buttons to move back-and-forth (+|-) between a list of GLB files. My HTML works on a regular browser. When I apply the same programming to the 8th wall editor, I get a different response.

I’m guessing that it has to do with the DOM. In the original HTML, I reference the model via getElementByID. Then I replace the GLB using the same concept. Works fine with the HTML but fails in the editor.

The problem is as follows…  
The HTML works fine when pressing +|-. If you advance one direction and then step back one, you end up on the original GBL. In the Editor, if you advance once, you get the next GLB. However, if you step back one, you get the GLB before the original.

Example…  
D+1=E, E-1=D  
vs  
D+1=E, E-1=C, E+1=F, F-1=B  
Hopefully, that makes sense.

Let me know if you have any thoughts on how to fix it.

---

<div class="post-metadata">

**Author:** ![Ian](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/ian/32/430_2.png) [@Ian](https://forum.8thwall.com/u/Ian)\
**Post date:** [June 12, 2024, 11:52pm UTC](https://forum.8thwall.com/t/blame-the-dom/1630/2 "2024-06-12T23:52:24Z")

</div>

can you share the code/logic you are using to do this?

Are you receiving any console errors or logs when this doesn’t work? Have you verified the button click in the editor with a log?

---

<div class="post-metadata">

**Author:** ![Matthew\_Campagna](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Campagna](https://forum.8thwall.com/u/Matthew_Campagna)\
**Post date:** [June 13, 2024, 2:46am UTC](https://forum.8thwall.com/t/blame-the-dom/1630/3 "2024-06-13T02:46:08Z")

</div>

All good questions! In my post, I did not include any code because I didn’t have my computer with me. I should have my laptop back in a few days. I’ll post the code then.

As always, thank you Ian,

MC

---

<div class="post-metadata">

**Author:** ![Matthew\_Campagna](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matthew\_Campagna](https://forum.8thwall.com/u/Matthew_Campagna)\
**Post date:** [June 22, 2024, 1:13am UTC](https://forum.8thwall.com/t/blame-the-dom/1630/4 "2024-06-22T01:13:39Z")

</div>

I solved this problem shortly after I got help with my other issue “8th Wall Renderer Causing Issues.” (the link included below) It took me about 5 hours to make it work, but it works. I was looking at a JS Component concept and had to shift over to a HTML concept.

Thank you @Ian for your willingness to always help.

Thank You @Mal_Duffin

> [@8th Wall Renderer Causing Issues](https://forum.8thwall.com/t/8th-wall-renderer-causing-issues/1666/5):
>
> @Mal_Duffin, Thank you! This is the type of thing I thought I was missing. Position as the issue makes total sense. And the suggestion of making a parent div and positioning it in front makes sense as well. I’m looking forward to applying these ideas later this evening.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/x8thwall/original/2X/9/9212a857458f1b03a6accb129e0f8cbea408e3e5.png) [@system](https://forum.8thwall.com/u/system)\
**Post date:** [June 26, 2024, 1:13am UTC](https://forum.8thwall.com/t/blame-the-dom/1630/5 "2024-06-26T01:13:43Z")

</div>

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.
