I have this statement
<div class="divShow">
<ul id="ulShow">
<li>
<h3 class="CompanyShow">A</h3>
<h2 class="ShowTitle">S</h2>
<input class="ExpShow" type="button" value="Edit">
</li>
<li>
<h3 class="CompanyShow">A2</h3>
<h2 class="ShowTitle">T1</h2>
<input class="ExpShow" type="button" value="Edit">
<li>
</ul>
</div>
When I click "Edit"
button I have to display the corresponding data.
When I click the "Edit"
button of the first list then it should display A
, and if I click the second li
it should dislay A2
.
How can I do this using jQuery?
$('.EditExp').live('click',function(){
$('.divShow ul li').each(function(){
alert($(this).parent().find('h3.CompanyShow').html());
});
});