After querying the relevant information, Div does not have the auto-scroll attribute and can only simulate mouse scrolling to achieve the desired effect.
The key part is here: div. scrollTop = div. scrollHeight;
The following is the simplified code:
Copy codeThe Code is as follows:
<Html>
<Body>
<Div id = "divDetail" style = "overFlow-y: scroll; width: 250px; height: 200px;">
<Table style = "border: 1px solid;">
<Tr> <td> id </td> <td> name </td> <td> age </td> <td> memo </td> </tr>
<Tr> <td> 000001 </td> <td> name1 </td> <td> 24 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000002 </td> <td> name2 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000003 </td> <td> name3 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000004 </td> <td> name4 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000005 </td> <td> name5 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000002 </td> <td> name2 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000003 </td> <td> name3 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000004 </td> <td> name4 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
<Tr> <td> 000005 </td> <td> name5 </td> <td> 23 </td> <td> memomemomemomemo </td> </tr>
</Table>
</Div>
</Body>
<Script type = "text/javascript" defer>
Var div = document. getElementById ('divdetail ');
Div. scrollTop = div. scrollHeight;
// Alert (div. scrollTop );
</Script>
</Html>
In fact, the implementation is very simple, but generally there is little such demand, and there are still some detours.