Hello guys. i just registered here. i have many posts in index page. and each post located in <li> tag.
- <ul>
- <li class="class_li" data-id="this_posts_id">
- < href="#" class="btn">Vote Up</a>
- <button class="btn dropdown-toggle" data-toggle="dropdown"><span class="vote"> VOTE </span><span class="caret"></span></button>
- </li>
- <li class="class1" data-id="this_posts_id">
- <!-- another <li> for other posts with same tags and class names -->
- </li>
- </ul>
and jquery part:
- $('a.btn').click( function(){
- var post_id = $(this).closest('li').data('id');
- var button = $('button.btn.dropdown-toggle').find('.vote').text('something here'); // this part doesn't work..
my problem is i cant reach span which under button tag. actually i tried many ways. but i only can change all post's vote in the page. i need reach THIS <li> tag's span. like how i got post_id.
i am stuck. tryin to make it for hours :(
thank you :)