How can I get/set the firstChild's attribute "data-id"? I can set name and inner text of a textarea :
el.firstChild.name='txt_'+j;
el.firstChild.innerText = 'Textarea '+j;
what I am trying to do is to change "data-id' value like this (pseudocode):
el.firstChild.data('id')=j;
Just to clarify - a bit of HTML:
<div id="5" class="textarea_cloned">
<textarea name="txt_5">Textarea 5</textarea>
<div class="remove" data-id="5"> X </div>
</div>
Thank you