The website I chose was "Click to Confirm". Between the script tags, the developer created a constant named “r” which chooses a random item from the array named “a”.
The array is filled with multiple words which form a sentence when put together. However, to guarantee that a coherent sentence
would be created the developer divided the words into 4 sections; personal pronouns, first adjective, conjunctions, and second adjective.
They enclosed each section in “[]” and separated them with commas (,).
The following code “const dv = document.querySelector('div');
the second part of the code made it so that the first “div” element gets repeated 9 times.
The first “div” element included the red marker on the left, the patterned image, and the paragraph ('p'p') which is where the created sentence goes.
Moving on the following code “const ds = document.querySelectorAll('details');
const ps = document.querySelectorAll('p');” This selects all details and
elements, storing them in the ds and ps arrays, respectively. And lastly,
is the code that takes care of activating the creation of a new phrase every time a “detail” or patterned image gets clicked while closing the previous
“detail” that was opened and erases the phrase that was created.