We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79dcd51 commit f8434b6Copy full SHA for f8434b6
10 - Hold Shift and Check Checkboxes/index-START.html
@@ -104,6 +104,29 @@
104
</div>
105
106
<script>
107
+ var checkboxes = document.querySelectorAll('.inbox input[type="checkbox"]');
108
+ var lastChecked;
109
+
110
+ function handleCheck(e) {
111
+ var inBetween = false;
112
113
+ if (e.shiftKey && this.checked) {
114
+ checkboxes.forEach(checkbox => {
115
+ if (checkbox === this || checkbox === lastChecked) {
116
+ inBetween = !inBetween;
117
+ }
118
119
+ if (inBetween) {
120
+ checkbox.checked = true;
121
122
+ });
123
124
125
+ lastChecked = this;
126
127
128
+ checkboxes.forEach(checkbox => checkbox.addEventListener('click', handleCheck));
129
130
</script>
131
</body>
132
</html>
0 commit comments