I have below html code,
<div id="one">
<div style="width:100%;height:auto;">
<div></div>
<div></div>
<div>
</div>
Code used:
let parentDivId = document.getElementById('one').children[0];
console.log(parentDivId);
In the above console only i am getting
<div style="width:100%;height:auto;">
<div></div>
<div></div>
<div>
How to get that first div style using pure java script?
Note: no need to add any id's in the the div's.the above html came dynamical
Need to get the first div with inline styles defined. Also i getting the above html inside a js variable.so document.query selector will not work.Please help me.