Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="http://www.polymer-project.org/components/platform/platform.js"></script>
  <link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html">
</head>
<body>
  <polymer-element name="jsbin-example" on-keypress="{{ keypressHandler }}">
    <template>
      <style>
        :host {
          display: block;
        }
      </style>
      
      <div id="pages" tabindex="0">Hello!</div>
    </template>
    <script>
      Polymer('jsbin-example', {
        ready: function() {
          this.$.pages.focus();
          console.log(this.shadowRoot.activeElement);
        },
        
        keypressHandler: function() {
          console.log('Caught keypress event');
        }
      });
    </script>
  </polymer-element>
  <jsbin-example></jsbin-example>
  
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers