I am working on an HTML page that contains a div positioned absolutely. My goal is to use Javascript to dynamically move this div downward whenever some data preceding it is generated. I have been experimenting with the .css jQuery function but unfortunately, it does not seem to be functioning as desired. Do you have any suggestions for achieving this task?
Below are the styles associated with the div on my page:
<div id="MyControl">
<%Html.RenderPartial("MyControl")%>
</div>
#MyControlControl {
position:absolute;
text-align:left;
left:100px;
top:900px;
}
In another section of my HTML, I am generating a dynamic table with records from a database. Whenever a new row is added, I would like to trigger a JavaScript function to move the div down by 50 pixels. So far, my attempts using both pure JavaScript (resulting in an "object expected" error) and jQuery's .css function have been unsuccessful. Any advice or solution would be greatly appreciated.