javascript - How to access element in a local DOM if id has dash? -
<dom-module id="name-tag"> <template> <div id="offices-list"></div> </template> <script> polymer({ is: "name-tag", ready: function() { var div_new = document.createelement('div'); polymer.dom(this.$.officeslist).appendchild(div_new); } }); </script> </dom-module>
this gives error:
uncaught hierarchyrequesterror: failed execute 'appendchild' on 'node': 1 element on document allowed.
however if changed id "offices-list" "officeslist", works. how can same thing keeping id is, i.e. dash?
this open issue/enhancement polymer:
https://github.com/polymer/polymer/issues/1747 https://github.com/polymer/polymer/issues/150
work around use this.$['offices-list']
Comments
Post a Comment