Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Getting null when accessing inner element from ons-template. Getting null when document.getElementById('infinite-list') is called from javascript

  • <ons-template id="home.html">
            <div class="left">
              <ons-toolbar-button onclick="">
                <ons-icon icon="ion-navicon, material:md-menu"></ons-icon>
                <div class="center">
                <ons-lazy-repeat id="infinite-list"></ons-lazy-repeat>

  • Onsen UI

    @raju That’s correct. It’s the way ons-template works. I’d recommend using native template element instead since it’s supported from v2.4.0 onwards.