How can I relocate a FAQ element into a div using JavaScript?

Hello!

I want to move a FAQ element inside another element (in this case inside a div), using javascript.

I add in theme.liquid a script with javascript code, I selected the element that I want to move and the element that will content., en moved it with appendChild.

No changes in the interface. Can you help me with this solution?

My code:

Thank you!

Can you share a link to the page you’re working on (with the code you quoted), that will help us figure out the issue.

1 Like

Thank you for your answer!

Link: https://bm5eorh2q6ckllo1-55085793316.shopifypreview.com/products_preview?preview_key=e01e7dfcfd9104816c81bcd4a4a9ef87&variant=39683260284964

In the bottom there is a FAQ section. I want to move after the button “buy it now”… I want to have the the effect for close an open the text, because my product description is very long and I don’t like how render it.

Thank you!

Hi @OlegSIAP ,

I really don’t understand your following request, where are you trying to move it? https://i.imgur.com/Bp1Rpg3.png

Please send me a screenshot with description on it. I will check it.

Hello!

I already did.

Thank you for your help!

You can try something like this and see if it works:

1 Like