There is a probelm in getting a textbox value using jquery it is store in while loop following is my design code
<?php
while($raw=mysqli_fetch_array($result))
{
?>
<input type="text" name="comment" id="comment" class="comment"/>
<input type="button" name="btncmnt" id="btncmnt" class="btncmnt"/>
<?php
}
?>
Here is my jquery code
<script type="text/javascript">
$(document).ready(function(){
$(".btncmnt").click(function(){
var comment=$(this).val(".comment");
alert(comment);
//this will be display only first textbox value
});
});
</script>
When i click another button of the loop then it will be display first texbox value please give me ans to get current textbox value thank in advance