Cannot change content with javascript



  • I’m using onsen ui version 1, followed https://onsen.io/v1/guide.html 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>";
        ons.compile(content);
    

    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.


Log in to reply