The working form of the link is as: image #1 If I understand this correctly, it is defined in the js file here: var objCaption = document.createElement("span"); objCaption.setAttribute('id','caption'); objImageDetails.appendChild(objCaption); Which becomes: I'm trying to have the output something as: