# How can I create a click event for a hamburger menu item?

**URL:** <https://community.fliplet.com/t/how-can-i-create-a-click-event-for-a-hamburger-menu-item/494>\
**Category:** Get Help\
**Created:** [March 20, 2023, 2:42pm UTC](https://community.fliplet.com/t/how-can-i-create-a-click-event-for-a-hamburger-menu-item/494 "2023-03-20T14:42:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brocha](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@brocha](https://community.fliplet.com/u/brocha)\
**Post date:** [March 20, 2023, 2:42pm UTC](https://community.fliplet.com/t/how-can-i-create-a-click-event-for-a-hamburger-menu-item/494/1 "2023-03-20T14:42:31Z")

</div>

I need to take the user to a specific screen in the app when they click on a hamburger menu item, but I need to add a dynamic query parameter, so I can’t use the built in option to take the user to another screen. How can I add a click event using JavaScript that will work with the hamburger menu?

---

<div class="post-metadata">

**Author:** ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)\
**Post date:** [March 20, 2023, 5:31pm UTC](https://community.fliplet.com/t/how-can-i-create-a-click-event-for-a-hamburger-menu-item/494/2 "2023-03-20T17:31:08Z")

</div>

In order to this you need to inspect the menu to find the class you need to be targeting. In this case we need to be looking at this:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/fliplet/original/1X/b81203d08571d1eeeafdc95c7cb5327851037757.jpeg)

Here you can see that the parent class we need to inspect is `linked with-icon focus-outline` and in order to target a specific menu item we need to match with the Text inside the menu item. In my example lets target the click event on the Home button. See code example:

```auto
//Here we are targeting a click event on the class we found. 
$(document).on('click', '.linked.with-icon.focus-outline', function(){
//We need to log the text of the clicked item to see if it matches 
  console.log($(this).text().trim())
//if the text matches the one we are looking for
  if ($(this).text().trim() === 'Home'){
//If it matches then navigate to the required screen. 
    Fliplet.Navigate.screen(123456)
  }
})

```

In order for this to work with the menu we need to add this to the Global JS so it can run on every screen.

Hope this helps,  
Deb
