-1

I am not able to get the selected value from breadcrumbs.

The breadcrumbs is this way:

<ul class="breadcrumbs">
    <li><a href="#">Home</a></li>
    <li><a href="#">Products</a></li>
    <li class="active">Accessories</li>
</ul>

I tried to do this:

$("#breadcrumbs li:selected").text()

but it doesn't work. Somebody can help me?

Kartikeya Khosla
  • 18,495
  • 8
  • 42
  • 66
user880386
  • 2,607
  • 5
  • 28
  • 40
  • $(".breadcrumbs > li.active").text() but carefull if you have more than one .breadcrumb in DOM – tmg Apr 18 '16 at 11:26
  • Possible duplicate of [Difference between div id versus div class](http://stackoverflow.com/questions/544010/difference-between-div-id-versus-div-class) – zyexal Apr 18 '16 at 12:37

1 Answers1

1

Try something like this.

$(".breadcrumbs > li.active").text()

DEMO

Kartikeya Khosla
  • 18,495
  • 8
  • 42
  • 66