Alter .img src

Use querySelector to target the img directly: Why document.getElementById(‘MyCssId’).src doesn’t work As for .text, when you apply an ID to an Elementor widget, it is often applied a level up from the actual displayed image If you use this on the ID: You won’t update it.

Read More

Alter .textContent

Use querySelector to target the <p> directly: If your innerHTML includes double quotes or newlines You can use backticks instead of quotes: Why document.getElementById(‘MyCssId’).textContent doesn’t work When you apply an ID to an Elementor widget, it is often applied a level up from the actual displayed text, e.g. for ID=”MyCssId” applied to a Text Editor […]

Read More

Show / hide section by ID

You can use .style.display as normal, just make sure when you show it you are using ‘flex’ and not ‘inline’ if the element is a flex! Hide it: Show it

Read More