-
Notifications
You must be signed in to change notification settings - Fork 0
/
polymer1.html
50 lines (45 loc) · 1.87 KB
/
polymer1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<!-- 1. Load webcomponents-lite.min.js for polyfill support. -->
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js">
</script>
<!-- 2. Use an HTML Import to bring in some elements. -->
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-fab/paper-fab.html">
<link href="bower_components/iron-icons/iron-icons.html" rel="import">
<link rel="import" href="bower_components/iron-flex-layout/classes/iron-flex-layout.html">
</head>
<body>
<!-- 3. Declare the element. Configure using its attributes. -->
<paper-input label="Type your name here" required auto-validate error-message="needs some text!"></paper-input>
<input type="hidden" id="text1" name="text1" value="123"/>
<paper-button>Say Hello</paper-button>
<paper-fab mini icon="favorite" title="heart"></paper-fab>
<div id="greeting"></div>
<div class="horizontal layout">
<div class="flex-3">Alpha</div>
<div class="flex">Beta</div>
<div class="flex-2">Gamma</div>
</div>
<div class="horizontal layout wrap" style="width: 220px">
<div>Alpha</div>
<div>Beta</div>
<div>Gamma</div>
<div>Delta</div>
</div>
<script>
// To ensure that elements are ready on polyfilled browsers,
// wait for WebComponentsReady.
document.addEventListener('WebComponentsReady', function() {
var input = document.querySelector('paper-input');
var button = document.querySelector('paper-button');
var greeting = document.getElementById("greeting");
button.addEventListener('click', function() {
greeting.textContent = 'Hello, ' + input.value;
});
});
</script>
</body>
</html>