//Function for Adding Attribute(s) to HTML Elements.
function setAttributes( element , attributes ) { 
  for (const key in attributes) {
    element.setAttribute(key , attributes[key]);
     }
  }
  
  
 //Using SetAttributes Function to add Attributes.
 
setAttributes( imgElement , { 
  href : 'https://www.unsplash.com/pictures..',
  target : '_blank'
   }