-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (32 loc) · 1.35 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><input is="tristate-checkbox"></title>
<!-- Importing Web Component's Polyfill -->
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<link rel="import" href="src/tristate-checkbox.html">
</head>
<body>
<h1>Basic examples of how to use tristate-checkbox</h1>
<form action="" method="GET">
<p>To use the custom element, you must use the "is" attribute</p>
<pre><code><input is="tristate-checkbox" checked name="foo" id="bar"></input></code></pre>
<input is="tristate-checkbox" checked name="foo" id="bar"></input>
<p>Now you can add the "indeterminate" attribute</p>
<pre><code><input is="tristate-checkbox" indeterminate name="qux" id="baz"></input></code></pre>
<input is="tristate-checkbox" indeterminate name="qux" id="baz"></input>
<p>You can also create a "tristate-checkbox" in javascript</p>
<pre><code><script type="text/javascript">
var cb = new TristateCheckbox();
cb.setAttribute('indeterminate',true); //or simply cb.indeterminate = true;
document.body.appendChild(cb);
</script></code></pre>
<script type="text/javascript">
var cb = new TristateCheckbox();
cb.setAttribute('indeterminate',true); //or simply cb.indeterminate = true;
document.body.appendChild(cb);
</script>
</form>
</body>
</html>