What is wrong with this Javascript? shopping cart

后端 未结 3 1098
自闭症患者
自闭症患者 2021-01-29 13:47

There is something in this javascript or html which is is allowing the checkboxes to be ticked but for not even half a second. (I need the checks to stay there!) I also need the

3条回答
  •  春和景丽
    2021-01-29 14:08

    Your JS syntax is way off, this is what it should look like

    function addItems(field) {
        for (i = 0; i <= field.length-1; i++) 
        {
            if (field[i].checked == true)
            {
                if (computer[i]!=null) { 
                    selected[i] = computer[i];
                }
            }
        }
    }
    

提交回复
热议问题