openset
3/10/2016 - 10:25 AM

Updates existing images with new alt text

Updates existing images with new alt text

//Updates existing images with new alt text
function updateElemAttr(className, attribute, altText) {

  var element = document.getElementsByClassName(className);

  var elementArray = [];

  for (var i = 0; i < element.length; i++) {
    elementArray.push(element[i]);
    elementArray[i][attribute]=altText;
  }

  return elementArray;
}