- <!doctype html><html><head><meta charset="utf-8"><style>body{margin:0;font:16px sans-serif}#far{margin-top:3000px}button{margin:40px}</style></head><body>
- <button id="hidden">Add far away</button><button id="shown">Add here</button><div id="near"></div><div id="far"></div>
- <script>
- hidden.onclick=()=>{const p=document.createElement('p');p.textContent='Added far below';document.body.appendChild(p)};
- shown.onclick=()=>{near.textContent='Saved'};
- </script></body></html>
|