Check all Checkboxes with JS

Annoyed of checking a zillion of checkboxes? Just run the snippet and you are are good to go. Replace the „mycheckbox“ (first line at the end) with your desired checkbox classname.

var ele=document.getElementsByClassName('mycheckbox');   // Replace mychecbkox with your checkbox classname
	for(var i=0; i<ele.length; i++){  
    	if(ele[i].type=='checkbox')  
        ele[i].checked=true;  
	}

WHERE TO PLACE THIS CODE?

Just run the snippet with the help of your browser console.

Pleasure?

Please share your thumbsup, suggestions, edits, and questions within my comment section down there. 

I love posting snippets for you, but with a bit of feedback, it gets even more fun. 😀

Sharing is caring:

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert