This is called the Better version because it is more sophisticated and flexible in how the JS accomplishes its goal.
Sending the ids of the desired tags/elements (in this case, the id of the targeted image, which is 'theImage', as well as the id of the targeted text span, which is 'theDesc') to function showImage is a very useful method that helps prepare you for future JS examples we'll encounter in this course.
This version of random image JS was written by Daniel Arce, after code by Don Sinclair. Updated by Nadine Wettlaufer.Here is the Random Image -- one of 1, 2, 3, or 4, with accompanying text:
imgas a selector.
imgCSS rule in the style tags.