188
rated 0 times
[
194]
[
6]
/ answers: 1 / hits: 15460
/ 13 Years ago, sat, december 24, 2011, 12:00:00
I have this code:
<div class=item>
<div class=hidden>44</div>
<input type=submit id=btnAddCommentForAnswer value=Add Comment />
<script type=text/javascript>
$(document).ready(function () {
$('#btnAddCommentForAnswer').click(function () {
alert(XXX);
});
});
</script>
</div>
<div class=item>
<div class=hidden>12</div>
<input type=submit id=btnAddCommentForAnswer value=Add Comment />
<script type=text/javascript>
$(document).ready(function () {
$('#btnAddCommentForAnswer').click(function () {
alert(XXX)
});
});
</script>
</div>
what code should I put at XXX to get the content of the div with class=hidden when i press the button at the same div with class=item?
If you click the first button you should get 44, and for clicking the second button you get 12.
More From » jquery