Skip to content

Commit

Permalink
Merge pull request #91 from vaadin/demo-click
Browse files Browse the repository at this point in the history
Add a demo with a click listener
  • Loading branch information
limonte committed Jun 11, 2018
2 parents 07c54f6 + fd66fc1 commit 7ebf6ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demo/button-basic-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ <h3>Basic Button</h3>
<p>The <code>&lt;vaadin-button&gt;</code> element works the same as the native <code>&lt;button&gt;</code> element, but offers better styling support and accessibility features.</p>
<vaadin-demo-snippet id='button-basic-demos-basic'>
<template preserve-content>
<vaadin-button>Button</vaadin-button>
<vaadin-button id="my-button">Button</vaadin-button>
<script>
window.addDemoReadyListener('#button-basic-demos-basic', function(document) {
document.querySelector('#my-button').addEventListener('click', function(e) {
window.console.log(e.target.id + ' clicked');
});
});
</script>
</template>
</vaadin-demo-snippet>

Expand Down

0 comments on commit 7ebf6ab

Please sign in to comment.