Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script src="http://www.polymer-project.org/polymer.min.js"></script>
  
<polymer-element name="tag-name" attributes="" constructor="">
  <template>
    <style>
      @host {
        :scope { /* Default styles for the element. */
          display: block;
        }
      }
    </style>
    <div>Shadow DOM content</div>
    <content></content>
  </template>
  <script>
 
Polymer('tag-name', {
  created: function() {
    this.setAttribute('test', 'wow');
  },
  attributeChanged: function(attrName, oldVal, newVal) {
    //var newVal = this.getAttribute(attrName);
    console.log(attrName, 'old: ' + oldVal, 'new:', newVal);
    alert('newVal: '+newVal);
  }
});
  </script>
</polymer-element>
<tag-name></tag-name>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers