# How to highlight list item in a list

**URL:** <https://forum.ionicframework.com/t/how-to-highlight-list-item-in-a-list/1565>\
**Category:** ionic-v1\
**Created:** [March 4, 2014, 5:31am UTC](https://forum.ionicframework.com/t/how-to-highlight-list-item-in-a-list/1565 "2014-03-04T05:31:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saifulbakhtiar](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@saifulbakhtiar](https://forum.ionicframework.com/u/saifulbakhtiar)\
**Post date:** [March 4, 2014, 5:31am UTC](https://forum.ionicframework.com/t/how-to-highlight-list-item-in-a-list/1565/1 "2014-03-04T05:31:01Z")

</div>

I have a long list item in my app. how to highlight particular list item meaning user no need to scroll up or scroll down the list.

---

<div class="post-metadata">

**Author:** ![elm](https://avatars.discourse-cdn.com/v4/letter/e/57b2e6/32.png) [@elm](https://forum.ionicframework.com/u/elm)\
**Post date:** [March 4, 2014, 11:09am UTC](https://forum.ionicframework.com/t/how-to-highlight-list-item-in-a-list/1565/2 "2014-03-04T11:09:35Z")

</div>

If you want your list to scroll to a certain element you need to give that element an id `<div id="item-123" class="item">...` then you can use the $ionicScrollDelegate and $location in your controller like this:  
`$location.hash("item-123"); $ionicScrollDelegate.anchorScroll(true); // Scroll with animation. Set to false to jump in your list.`  
I didn’t try it but I think this works.

To visible highlight that item you need to set a class (maybe with ng-class="{highlight: item.isHighlighted}") and apply some css.

---

<div class="post-metadata">

**Author:** ![saifulbakhtiar](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@saifulbakhtiar](https://forum.ionicframework.com/u/saifulbakhtiar)\
**Post date:** [March 6, 2014, 1:32am UTC](https://forum.ionicframework.com/t/how-to-highlight-list-item-in-a-list/1565/3 "2014-03-06T01:32:05Z")

</div>

thanks. i will give a try.
