I am having issues figuring out how to get this working with pure Javascript. I know that by using document.getElementsByTagName('img')
I will need to loop through each instance of an image.
I am having no luck with everything I have tried. So far, I am just trying to test with the first image only.
var change = document.getElementsByTagName('img');
console.log(change);
change[0].onmouseover = function() {mouseOver()};
change[0].onmouseout = function() {mouseOut()};
function mouseOver() {
change[0].style.opacity = '0.6';
}
function mouseOut() {
change[0].style.opacity = '1';
}