# How to get which list item is clicked in Javascript?

**URL:** <https://forums.fusetools.com/t/how-to-get-which-list-item-is-clicked-in-javascript/3409>\
**Category:** How-to Discussions\
**Created:** [January 18, 2016, 5:58pm UTC](https://forums.fusetools.com/t/how-to-get-which-list-item-is-clicked-in-javascript/3409 "2016-01-18T17:58:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.mayur404](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/m.mayur404/32/82_2.png) [@m.mayur404](https://forums.fusetools.com/u/m.mayur404)\
**Post date:** [January 18, 2016, 5:58pm UTC](https://forums.fusetools.com/t/how-to-get-which-list-item-is-clicked-in-javascript/3409/1 "2016-01-18T17:58:41Z")

</div>

```auto
<StackPanel Padding="0,5,0,20">
  <Each Items="{data.options}">
    <optionPanel>
      <Text TextWrapping="Wrap" Value="{option}" Padding="40,15,40,15" TextColor="#fff" FontSize="18" Font="gMedium" TextAlignment="Right" Alignment="VerticalCenter" />
      <Clicked>
        <Callback Handler="{optionClicked}"/>
      </Clicked>
    </optionPanel>
  </Each>
</StackPanel>

```

In the above code when a list item is clicked optionClicked Handler is called. So in the optionsClicked Handler how to get which option is clicked?

---

<div class="post-metadata">

**Author:** ![Bjorn-Olav\_Strand](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bjorn-olav_strand/32/583_2.png) [@Bjorn-Olav\_Strand](https://forums.fusetools.com/u/Bjorn-Olav_Strand)\
**Post date:** [January 18, 2016, 9:21pm UTC](https://forums.fusetools.com/t/how-to-get-which-list-item-is-clicked-in-javascript/3409/2 "2016-01-18T21:21:51Z")

</div>

`args` will include the relevant part of `data.options` so you can check there.

---

<div class="post-metadata">

**Author:** ![m.mayur404](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/m.mayur404/32/82_2.png) [@m.mayur404](https://forums.fusetools.com/u/m.mayur404)\
**Post date:** [January 25, 2016, 7:50pm UTC](https://forums.fusetools.com/t/how-to-get-which-list-item-is-clicked-in-javascript/3409/3 "2016-01-25T19:50:58Z")

</div>

Thanks!

Worked!
