Since you're working on the outside of an element, document.querySelector and document.getElementById should be safe here. You're also not manipulating the element (appending/removing children or changing classes/attribute that could affect distribution).
Polymer.dom() is only needed when you're manipulating nodes. https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#dom-api On Sat, Jun 27, 2015 at 10:15 AM <[email protected]> wrote: > Hi: > > given that I have defined my polymer element > > <my-element></my-element> > > in the html > > and I have written a some Polymer functions. > i.e. > > <dom-module id="my-element"> > <template> > <div>content</div> > </template> > <script> > (function(){ > Polymer({ > is: 'my-element', > properties: { > > }, > doStuff: function(){ > alert('hello'); > } > }); > })(); > > </script> > </dom-module> > > How do can I call doStuff() using javascript in the html??? > > > <script> > var myelement = ?????? (is it document.get??? or > Polymer.dom(??).querySelector(??) ??? > myelement.doStuff(); > </script> > > Thanks > J. > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/02ed261a-28e1-466f-8b9d-c2c1af933146%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/02ed261a-28e1-466f-8b9d-c2c1af933146%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CACGqRCAhfELeu4F3tQGK9wLp6TO7C6TijCwge6cWU50_f-HYQw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
