Only one checkbox

xiaoxiao2021-03-05  23

The webpage often needs to dynamically generate multiple check boxes, and there is usually a "all-in" button to select all check boxes or cancel the selected.

But a question that needs attention is that when only one check box is left, you cannot use the check box Length property.

var selectallflag = false;

Function gotoforallselect () {var doc = document.form1; var l= doc.cheifselected.length if (l == null) {l = 1;} if (l == 1) {if (! selectallflag) {doc.cheifselected } else {doc.cheifselected.checked = false;}} else {for (i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-38664.html

New Post(0)