# How can I read the value of a menu item within a sub menu and make an action as the item is clicked?

**URL:** <https://forum.wixstudio.com/t/how-can-i-read-the-value-of-a-menu-item-within-a-sub-menu-and-make-an-action-as-the-item-is-clicked/58693>\
**Category:** Ask the community\
**Tags:** technical-talk, question, wix-editor, code, wix\
**Created:** [April 30, 2024, 6:04pm UTC](https://forum.wixstudio.com/t/how-can-i-read-the-value-of-a-menu-item-within-a-sub-menu-and-make-an-action-as-the-item-is-clicked/58693 "2024-04-30T18:04:08Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [May 1, 2024, 10:50am UTC](https://forum.wixstudio.com/t/how-can-i-read-the-value-of-a-menu-item-within-a-sub-menu-and-make-an-action-as-the-item-is-clicked/58693/8 "2024-05-01T10:50:46Z")

</div>

Correct.

1. you click a menu-item
2. you get the menu-data
3. you create an if-else-condition
4. you start a function → regarding the result of → IF-ELSE-CONDITION

```javascript
if(label === 'xyz') {console.log('do something')}
else {console.log('do something else');}

```

---

_[View the full topic](https://forum.wixstudio.com/t/how-can-i-read-the-value-of-a-menu-item-within-a-sub-menu-and-make-an-action-as-the-item-is-clicked/58693)._
