Check out the codepen here

back to table of contents

short explanation

You know, how, in english, you have sentences? This is one sentence. Here is another sentence. And, one more.

Similarly, in programming, most of the code is written in sentences, where you write your brain/action portions. In other words, statements are found in JavaScript code. you dont find them in HTML or CSS.

Here is a statement that grabs a DIV DOM element.

let tempImage1 = document.getElementById('image1');

Here is another statment. This one is getting an attribute.

let mySrc = tempImage1.getAttribute('src');

important note

This code is provided as is without any warranties. It’s primarily meant for my own personal use, and to make it easy for me share code with my students. Feel free to use this code as it pleases you.

I can be reached through my website - Jay’s Developer Profile