I want get test
inside this example. Why it doesn't work?
HTML
<div id="partTypes">
<div class="partType">
<div class="details"> <span class="name">test</span>
</div>
<div class="buttons">
<input class="addCart" type="button" value="click me" />
</div>
</div>
</div>
JAVASCRIPT
$(document).ready(function () {
$('input.addCart').live('click', function () {
var $partType = $(this).closest('div.partType');
alert($partType.filter('span.name').text());
});
});