javascript - Traverse DOM tree of Polymer element -
is possible traverse dom subtree when using polymer element custom-element
like
<polymer-element name="custom-element" attributes="something"> <template> </template> <script> // access ul , li actual dom here. </script> </polymer-element> <body> <custom-element something="foo"> <ul> <li>bar</li> <li>hello</li> </ul> </custom-element> </body>
i want able parameterize polymer element using markup that's wrapped it.
actually, this.children
allows access them.
<polymer-element name="custom-element" attributes="something"> <template> </template> <script> polymer({ created: function() { console.log(this.children); } }); </script> </polymer-element>
Comments
Post a Comment