Jump to content

problems with innerHTML

Recommended Posts

Guest natealex

I have a weird issue whenever I try to use the innerHTML function in an embedded block. The function does not seem to work properly when multiple blocks are embedded on the same page. Multiple blocks all display the same image even if the code is different. I don't believe this is a coding issue on my end because if I replace innerHTML with textContent, the data pulls correctly.

Anyone else have this issue?

Images have been attached for clarity. This is the exact same JS, but one uses getElementByID('element').textContent, and the other uses getElementByID('element').innerHTML
You can see that the textcontent pull has different data while the innerHTML returns identical data.

textContent.JPG

innerHTML.JPG

Link to comment
  • Replies 0
  • Views 497
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.