Monaca Onsen UI Discord Chat Github Repo

Cannot change content with javascript

  • I’m using onsen ui version 1, followed to make changes to DOM

    This section to be exact

    // Add another Onsen UI element
        var content = document.getElementById("my-content");
        content.innerHTML="<ons-button>Another Button</ons-button>";

    The problem is nothing changed on the page.

    If i dump “content” variable or dump the HTML element it shows the newly edited version on browser console. but on page still the old one.

    ons object is instantiated.

  • @Broo0d Can you use version 2? It’s a lot easier to work with.