set attribute to image element javascript in DOM code example
Example 1: set attribute javascript
Element.setAttribute(name, value);
Example 2: js get image src
var youtubeimgsrc = document.getElementById("youtubeimg").src;
Element.setAttribute(name, value);
var youtubeimgsrc = document.getElementById("youtubeimg").src;