1document.body.classList.add('thisClass');
2// $('body').addClass('thisClass');
3
4document.body.classList.remove('thatClass');
5// $('body').removeClass('thatClass');
6
7document.body.classList.toggle('anotherClass');
8// $('body').toggleClass('anotherClass');
1$('.check-fields').on('click', function () {
2
3 var reqlength = $('.required-entry').length;
4 console.log(reqlength);
5 var value = $('.required-entry').filter(function () {
6 return this.value != '';
7 });
8
9 if (value.length>=0 && (value.length !== reqlength)) {
10 alert('Please fill out all required fields.');
11 } else {
12 alert('Everything has a value.');
13 }
14});