JSFiddle - React, Tailwind, and code Playground
HTML
<div style="display: inline;
position: relative;
float: left;">
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
<a name="a2" href="javascript:toCurrentPosition()">Show Details</a> <br />
Long text <br />
...
JavaScript
function toCurrentPosition() {
var div = document.getElementById('update');
//div.style.top = window.pageYOffset;
//div.style.top = document.body.parentElement.scrollTop;
//div.style.top = document.body.scrollTop;
div.style.top = '100px';
}