Creating an event listener

i want to Add a *click* listener to the *BUTTON* with id of *my-complex* . The listener should make a call to *myPlazaName* and pass in the parameter *myPlazaInfo* received

my code

```js const myPlazaInfo = (myPlazaName) =>{ document.getElementById("my-complex").addEventListener("click", myPlazaName); ```

click event | MDN

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

As far as what you are trying to accomplish, the following takes care of the click event listener:

document.getElementById("my-complex").addEventListener("click", myPlazaName);

Now, you just need to correctly define your myPlazaName function (separately) and have it do what ever you want it to do with the argument passed to it.

pls i am getting" estraverse" is not defined in my code execution plz wat does it mean

const displayExtraUserInfo = (wande) =>{
        document.getElementById("btn-birthdate").addEventListener("click", function (){
          displayBirthdate();
        });
        document.getElementById("btn-phone").addEventListener("click", function() {
          displayPhone();
        });
        document.getElementById("btn-address").addEventListener("click", function(){
          displayAddress();
        });
      };

you cant put javascript inside html tags. you have to put it inside a script tag

then give and id=" " the tag that you want to listen to

in the callback function that your listener uses, use .innerHTML at the end of your tag reference in your javascript and make it = to what you want to display