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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -