I have few rows in my html table . And in that I am able to get the value of textarea control .
But I required to get the ID of the textarea control on button click.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
22 Points
68 Posts
How to get the Id of texarea
Apr 03, 2018 05:33 PM|Beginer|LINK
Dear All,
I have few rows in my html table . And in that I am able to get the value of textarea control .
But I required to get the ID of the textarea control on button click.
Can any one please help me how can I make it.
All-Star
30731 Points
11182 Posts
Re: How to get the Id of texarea
Apr 03, 2018 06:33 PM|mgebhard|LINK
I can only assume you are rendering the HTML? Simply refactor the code to pass the textarea Id or textarea element rather than "this".
All-Star
50031 Points
9684 Posts
Re: How to get the Id of texarea
Apr 03, 2018 07:02 PM|A2H|LINK
You can use attr method to get the id value of textbox controls.
Updated Code
A2H
My Blog | Dotnet Funda
Contributor
6440 Points
2693 Posts
Re: How to get the Id of texarea
Apr 04, 2018 05:09 AM|Eric Du|LINK
Hi Beginer,
According to your description, you could use attr to get the value, about how to use this function, please check the following tutorial:
jquery .attr():
http://api.jquery.com/attr/
Also about the complete sample code, please check the following code:
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.