Click to copy text

Currently, this is how the info area looks:

For the click to copy feature, if you hover the mouse over the room URL, it should show a Copy button:

If you click the Copy button, it should copy the text and turn into the Copied button:

For this functionality, we need to add some event listeners. So, inside your home class, create a new method addEventListeners() and call it inside the constructor:

class Home { constructor() ...

Get JavaScript by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.