Getting value from its div set having same class name
I have multiple elements having same class names as below:
<div class="call-now">First</div> <div class="hideme">1234</div> <div class="call-now">Second</div> <div class="hideme">8855</div> <div class="call-now">Third</div> <div class="hideme">7411</div>
Whenever call-now is clicked it should show the value from its hideme div on its click. Currently by below code it alerts all possible values from all hideme elements:
$('.call-now').on('click', function() {
alert($('.hideme').text());
});
I want to alert the value 1234 when first call-now is clicked, 8855 when second call-now is clicked and 7411 when 3rd call-now is clicked. I also tried below with each but no luck:
$('.call-now').on('click', function() {
$('.hideme').each(function(){ alert($("this").text()); })
});