<table class="cssTable">
<tr>
<td>
<textarea id="txtOption1" cols="30" rows="2">Text1</textarea>
</td>
</tr>
</table>
<table class="cssTable">
<tr>
<td>
<textarea id="txtOption2" cols="30" rows="2">Text2</textarea>
</td>
</tr>
</table>
<asp:Button ID="btnClick" runat="server" OnClientClick="ClickMe();" Text="Submit" />
I try this to get the value of textarea separate:
function ClickMe() {
$(".cssTable").each(function () {
alert($("[Id*=txtOption]").text());
});
}
but getting the both text as text1text2 both time.
You need specify the context
Though you should be using .val() to get the value of textarea