skip to Main Content

I’m working on a wix site using custom HTML and javascript.
enter image description here

Although I know the block’s id is html2, I cannot update the innerhtml from the javascript below it. it won’t udpate.
I know the value is valid. Why can I not access html2.innerHTML?

Thanks

2

Answers


  1. Try using the native API with document.querySelector('#html2'). Additionally, avoid using var if not necessary. If it doesn’t work, please check whether the onReady function is functioning correctly.

    Login or Signup to reply.
    1. Use the Wix text element if you just want to display the text and call,
      $w('#html2').text = stardate;

    2. You can use postmessage api to send message to your embedded html and receive it by onmessage in your embedded html code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search