var newForm = document.getElementById('new-form'); if ( newForm.getAttribute('class') === 'make-blue' ) { // Do something }