If i have some code like below, a element contains under 3 layers
<span class="dropdown test1">
<span class="test2" type="button" data-toggle="dropdown">hello</span>
<ul class="dropdown-menu test3" style="min-width:100px;text-align:centerz-index:999;">
<li class="CTHK-{{feedId}} test4" data-url="{{url}}" style="width: 100%; height: 100%;margin-left: 0px !important; margin-top: 0px !important;margin-bottom: 0px !important;"><a href="javascript:void(0)">Btn list</a></li>
<div class="divider"></div>
</ul>
</span>
i want it to console the word "hello" inside class test2
i tried console.log($(this).parent().parent(".test2").text());
i must use this because i am using for loop to genarate datas if i set a consistence class it can't identify which is which
.closest(SELECTOR)
instead.. – Rayon May 23 '16 at 5:31this
you are referring... – Rayon May 23 '16 at 5:34