<table class="csstable">
<tr>
<td>
<textarea id="txtOption" rows="2" cols="30">hi this is me!!!</textarea>
</td>
</tr>
<tr>
<td>
<textarea id="txtOption" rows="2" cols="30">hi this is you!!!</textarea>
</td>
</tr>
What i did:
$(".csstable").each(function(){
alert($("#txtOption").val());
});
I am getting the first value of text area at both time ie.hi this is me!!!
You cannot have two id’s with the same value on a page, that is invalid.
ID must be unique.
Try using a class (or something else) to select instead