I dont know good method how to get DOM element from template by javascript.
Example template:
<script id = "template" type="text/template"><div>text1</div><div>text2</div><div>text3</div></script>
For example i want get div with "text2"
There is ways which i know, all of them are bad:
Add "class" to all elements - it breaks semantics (class created for CSS). In big projects you must use very long names for classes, its very inconvenient.
Get element by his number (index) - when adding a new element, you must rewrite old numbers in your code.