var checkboxnewdivs = document.querySelectorAll('input[name="checkboxnewdivs"]:checked').value;
Should be
var checkboxnewdivs = document.querySelectorAll('input[name="checkboxnewdivs"]:checked');
The first one is trying to get a value
property from a node collection, which will obviously be undefined.
You also had some typos (double 's') and don't define array
anywhere. Define that where you defined checkboxnewdivs
.
Working demo: https://jsfiddle.net/mitya33/m9L2dvz5/1/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…