Add a class to a div at a condition : The following is my code I wanted to add a class to a div when a certain condition is true. Tried jquery also but didn't worked. My code is as follows

    $('.addressStatus').each(function(index, value){
    			var el = 0;
    			if($(this).data('status') == true){
    				
    				 el =  $(this).data('param1');
    				 console.log(el);
    				 var id = document.getElementById('statusID'+el);
    				 id.classList.add('inactiveAddrsColor');
    			 //  id.className += id.className ? ' inactiveAddrsColor' : 'inactiveAddrsColor';
    
    		    //element.classList.add('inactiveAddrsColor');
    	 		//	$('statusID'+el).addClass('inactiveAddrsColor');   								
    			}
    			});