Use <ons-template> instead
index.html:
<ons-tabbar>
<ons-tabbar-item page="home.html" label="Home" icon="ion-home" active="true"></ons-tabbar-item>
<ons-tabbar-item page="comments.html" label="Comments" icon="ion-chatbox-working"></ons-tabbar-item>
<ons-tabbar-item page="tags.html" label="Tags" icon="ion-ios7-pricetag"></ons-tabbar-item>
<ons-tabbar-item page="settings.html" label="Settings" icon="ion-ios7-cog"></ons-tabbar-item>
</ons-tabbar>
<script type="text/ons-template" id="home.html">
<!--ons-template id="home.html"-->
<ons-toolbar>
<div class="center">Home</div>
</ons-toolbar>
<div id="myDIV"></div>
<p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p>
<!--/ons-template-->
</script>
<ons-template id="comments.html">
<ons-toolbar>
<div class="center">Comments</div>
</ons-toolbar>
<div id="myDIV2"></div>
<p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p>
</ons-template>
<ons-template id="tags.html">
<ons-toolbar>
<div class="center">Tags</div>
</ons-toolbar>
<p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p>
</ons-template>
<ons-template id="feed.html">
<ons-toolbar>
<div class="center">Feed</div>
</ons-toolbar>
<p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p>
</ons-template>
<ons-template id="settings.html">
<ons-toolbar>
<div class="center">Settings</div>
</ons-toolbar>
<p style="padding-top: 100px; color: #999; text-align: center">Page Contents</p>
</ons-template>
Javascript:
ons.bootstrap();
alert(document.getElementById("myDIV"));
alert(document.getElementById("myDIV2"));
Here you see the first alert will be null but the 2nd alert, we can see the DIV.
See the above live sample at http://codepen.io/vnguyen972/pen/eagAr
Hope this helps!