Since we have a few areas to click on, it may be helpful to show users which sections they have viewed by changing the text inside the 'Recent Projects' buttons.
When a user clicks on a button, we will permanently change the text of the button to 'Projects Viewed'.
We can change the text of an element with the jQuery function
text. It's syntax looks like this:
text attaches directly to a jQuery selector.
- Inside of
text's parentheses, we can provide text that will become the text of our DOM element. The text we supply will replace any existing text, and if the element has no pre-existing text,
text will add it.