I have the following code:
<div></div>
<div>
<div class='minhaClasse'>
<div id='text'>hhaushdus</div>
<input name='profile_id' />
<div>
</div>
I need to get this div
:
<div class='minhaClasse'>
<div id='text'>hhaushdus</div>
<input name='profile_id' />
<div>
I tried this way:
let element = document.getElementsByName('profile_id')[0].parentNode;
This returned my father:
<div>
<div class='minhaClasse'>
<div id='text'>hhaushdus</div>
<input name='profile_id' />
<div>
</div>
Basically, these are two questions, how do I get this div
with the class 'myClass' and if you have a getElement
of a getElement
type:
document.getElementsByName('profile_id')[0].parentNode.getElementByClassName('minhaClasse'));