O'Reilly logo

JavaScript by Example by Dani Akash S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a room

The first step of this app is to create a room so that other members can join a call in the room. As per the current UI design, we need to create the room when the user clicks the Create Room button. So, let's register a click event handler on that button.

So far, we have been using different methods to handle events:

  • In our ToDo list app, we added the onclick attribute to the HTML to call JavaScript functions onclick event.
  • In the Meme Creator, we attached event listeners to each element, where we wanted to listen for a specific event to happen (keyup, change, and click events). The same goes for the Event Registration form, where we added an event listener to listen for the form submit action.
  • There is also another method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required