De asemenea, puteți utiliza codul de mai jos pentru a obține toate valorile casetelor de selectare bifate.
- <scenariu>
- document.getElementById ('btn').onclick = function ()
- var marcatCheckbox = document.querySelectorAll ('input [type = "checkbox"]: bifat');
- pentru (var casetă de selectare a marcatCheckbox)
- document.corp.anexa (caseta de selectare.valoare + '');
- </ script>