| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 |
| 14 <title>iron-form-element-behavior demo</title> |
| 15 |
| 16 <meta charset="utf-8"> |
| 17 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 18 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initia
l-scale=1, user-scalable=yes"> |
| 19 |
| 20 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 21 |
| 22 <link rel="import" href="simple-form.html"> |
| 23 <link rel="import" href="simple-element.html"> |
| 24 |
| 25 </head> |
| 26 <body> |
| 27 |
| 28 <form is="simple-form" id="form"> |
| 29 Element the form is tracking: <input is="simple-element" type="text" name=
"one" value="one"> |
| 30 <br> |
| 31 Element the form isn't tracking: <input type="text" name="two" value="two"
> |
| 32 <br> |
| 33 Another one the form is tracking: <input is="simple-element" type="text" n
ame="three" value="three"> |
| 34 |
| 35 </form> |
| 36 |
| 37 <h4>Elements tracked by the form: </h4> |
| 38 <ul id="output"> |
| 39 </ul> |
| 40 </body> |
| 41 <script> |
| 42 var output = document.getElementById('output'); |
| 43 var elements = document.getElementById('form').formElements; |
| 44 |
| 45 for (var i = 0; i < elements.length; i++) { |
| 46 var li = document.createElement('li'); |
| 47 var text = document.createTextNode(elements[i].value); |
| 48 li.appendChild(text); |
| 49 output.appendChild(li); |
| 50 } |
| 51 </script> |
| 52 |
| 53 </html> |
| OLD | NEW |