Commit 3675dfc079b45affd92204fb11b0552a217ad932

Authored by Andrei Pfeiffer
1 parent a670139d
Exists in master

Update example html, don't toggle the static multiple file input

Showing 1 changed file with 5 additions and 5 deletions   Show diff stats
docs/index.html
... ... @@ -40,7 +40,7 @@
40 40 <label>
41 41 <strong>Default</strong> (no accept attr)
42 42 <br>
43   - <input type="file" />
  43 + <input type="file" class="toggle-multiple" />
44 44 </label>
45 45 </p>
46 46 <br>
... ... @@ -48,7 +48,7 @@
48 48 <label>
49 49 <strong>Accept "image/*"</strong>
50 50 <br>
51   - <input type="file" accept="image/*" />
  51 + <input type="file" accept="image/*" class="toggle-multiple" />
52 52 </label>
53 53 </p>
54 54 <br>
... ... @@ -56,7 +56,7 @@
56 56 <label>
57 57 <strong>Accept "video/*"</strong>
58 58 <br>
59   - <input type="file" accept="video/*" />
  59 + <input type="file" accept="video/*" class="toggle-multiple" />
60 60 </label>
61 61 </p>
62 62 <br>
... ... @@ -64,7 +64,7 @@
64 64 <label>
65 65 <strong>Accept "image/*, video/*"</strong>
66 66 <br>
67   - <input type="file" accept="image/*, video/*" />
  67 + <input type="file" accept="image/*, video/*" class="toggle-multiple" />
68 68 </label>
69 69 </p>
70 70 <br>
... ... @@ -82,7 +82,7 @@
82 82 const toggleMultiple = document.getElementById("toggle-multiple");
83 83 const toggleMultipleText = toggleMultiple.querySelector("span").textContent;
84 84 toggleMultiple.querySelector("input").addEventListener("change", event => {
85   - document.querySelectorAll("input[type='file']").forEach(input => {
  85 + document.querySelectorAll(".toggle-multiple").forEach(input => {
86 86 if (event.target.checked) {
87 87 input.setAttribute("multiple", true);
88 88 } else {
... ...