Lab 10: JavaScript for the Web
Working with your partner, experiment with modifying the DOM.
Challenges
So, for this assignment, I had to tweak things a bit due to the changes in lecture order. But overall, I think it turned out swell.
I created a JavaScript function called generateRandomText to whip up random text from Tale of Two Cities. I played around with the min and max parameters, so now it can give us anything from short snippets to longer paragraphs.
Now, onto the styling part. I jazzed up the text elements using CSS. Specifically, I used the nth-child(even) selector to target every other element and applied some styles to evoke phone text dialogue.
Results
So, in a nutshell, these JavaScript and CSS tweaks not only made the assignment work with the lecture changes but also added a bit of flair to the visual side of things.
