-
Notifications
You must be signed in to change notification settings - Fork 0
/
autocapitalize-tests.html
68 lines (65 loc) · 1.64 KB
/
autocapitalize-tests.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html>
<head>
<title>autocapitalize test page</title>
</head>
<body>
<input type='text'>
<input type='search'>
<input type='email'>
<input type='password'>
<input type='url'>
<form></form>
<textarea></textarea>
<form autocapitalize='characters'>
<input>
<input type='email'>
<input type='password'>
<input type='tel'>
</form>
<fieldset>
<legend>set to 'on'</legend>
<input type='text' autocapitalize='on'>
<input type='email' autocapitalize='on'>
<input type='url' autocapitalize='on'>
<input type='password' autocapitalize='on'>
<input type='search' autocapitalize='on'>
<textarea autocapitalize='on'></textarea>
</fieldset>
<div id='log'></div>
</body>
<script>
function log(text) {
var entry = document.createElement('div');
entry.textContent = text;
document.getElementById('log').appendChild(entry);
}
function isSupported(elt) {
return 'autocapitalize' in elt;
}
var elements = [{
obj: document.querySelector('input[type=text]'),
name: 'input text',
}, {
obj: document.querySelector('input[type=email]'),
name: 'input email',
}, {
obj: document.querySelector('input[type=password]'),
name: 'input password',
}, {
obj: document.querySelector('input[type=url]'),
name: 'input url',
}, {
obj: document.querySelector('form'),
name: 'form',
}, {
obj: document.querySelector('textarea'),
name: 'textarea',
}];
elements.forEach(function(elt) {
log('> ' + elt.name)
log('is supported: ' + isSupported(elt.obj));
log('default value: ' + elt.obj.autocapitalize);
});
</script>
</html>