OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <body> | |
3 <style> | |
4 input { | |
5 -webkit-appearance: none; | |
6 background-color: white; | |
7 border: none; | |
8 color: black; | |
9 margin: 2px; | |
10 padding: 2px; | |
11 outline-offset: 0; | |
12 } | |
13 </style> | |
14 <div><input type="button" value="button"></div> | |
15 <div><input type="checkbox" value="checkbox"></div> | |
16 <div><input type="color" value="#ff0000"></div> | |
17 <div><input type="date" value="2013-09-05"></div> | |
18 <div><input type="file"></div> | |
19 <div><input type="hidden" value="hidden"></div> | |
20 <div><input type="number" value="3.141592"></div> | |
21 <div><input type="radio"></div> | |
22 <div><input type="range"></div> | |
23 <div><input type="search" value="search"></div> | |
24 <div><input type="text" value="text" placeholder="placeholder"></div> | |
25 <script> | |
26 window.onload = function() { | |
27 var inputs = document.querySelectorAll('input'); | |
28 for (var i = 0; i < inputs.length; ++i) { | |
29 var contentSpan = document.createElement('span'); | |
30 contentSpan.textContent = 'Content'; | |
31 inputs[i].appendChild(contentSpan); | |
32 inputs[i].createShadowRoot().innerHTML = '<span>Shadow!</span><content s
elect="*"></content>'; | |
33 } | |
34 var text = document.querySelector('input[type=text]'); | |
35 text.focus(); | |
36 text.value = 'updated'; | |
37 text.setRangeText('range', 0, 7); | |
38 }; | |
39 </script> | |
40 </body> | |
OLD | NEW |