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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.