<div class="main">
<button class="btnClick" type="button"> </button>
<button class="btnClick" type="button"> </button>
<div class="child">
<p> ** Some child Text ** </p>
<textarea id="edit" class="hidden"></textarea> //class hidden == Display:none
</div>
</div>
<div class="main">
<button class="btnClick" type="button"> </button>
<button class="btnClick" type="button"> </button>
<div class="child">
<p> ** Some child Text ** </p>
<textarea id="edit" class="hidden"></textarea> //class hidden == Display:none
</div>
</div>
Am trying to implement the edit section with the above code. The above <div> is generated dynamically and when user click the button i need to hide the <p> "** Some child Text ** " and make the Textarea visible for that particular Div and copy the
section to Textarea
I tried On Button Click
$(this).closest('#edit').removeClass("hidden");
but it didn't worked and with the other code every time only first textarea is visible irrespective of which button i click
What am looking for is on the first button click the particular <div> textarea class hidden to be removed and copy the<p> text to Textarea on that particula <div>
What is the best way to do this. and i can add any new class and make code generic. Your ideas !!