For example, I have the following code that showcases 3 div boxes per row across multiple rows on my webpage:
<div id='row1col1' class='duty' style="top:50px ; left:50px " ></div>
<div id='row1col2' class='duty' style="top:50px ; left:150px " ></div>
<div id='row1col3' class='duty' style="top:50px ; left:250px " ></div>
<div id='row2col1' class='duty' style="top:150px ; left:50px " ></div>
<div id='row2col2' class='duty' style="top:150px ; left:150px " ></div>
<div id='row2col2' class='duty' style="top:150px ; left:250px " ></div>
<div id='row3col1' class='duty' style="top:250px ; left:50px " ></div>
<div id='row3col2' class='duty' style="top:250px ; left:150px " ></div>
etc
I am looking to dynamically position a new div and modify it based on the id or other attribute of the div directly above it. Since the parent div is different, is there a way to retrieve this information? Given that I know the 'top' and 'left' positions, can I obtain the ID of a div this way?
Any assistance would be appreciated.