JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input type="checkbox" onclick="myFunction()" /> One
<br/>
<input type="checkbox" onclick="myFunction()" /> two
<br/>
<input type="checkbox" onclick="myFunction()" /> three
<br/>
<input type="checkbox" onclick="myFunction()" /> four
<br/>
<input type="checkbox" onclick="myFunction()" /> five
<br/>
<input type="checkbox" onclick="myFunction()" /> SIx
<br/>
<input type="checkbox" onclick="myFunction()" /> seven
<br/>
<input type="checkbox" onclick="myFunction()" /> eight
<br/>
<input type="checkbox" onclick="myFunction()" /> nine
<br/>
<input type="checkbox" onclick="myFunction()" /> ten
<br/>
</form>
CSS
[type='checkbox'] {
height: 200px;
}
JavaScript
$(window).scroll(function() {
sessionStorage.scrollTop = $(this).scrollTop();
});
$(document).ready(function() {
if (sessionStorage.scrollTop != "undefined") {
$(window).scrollTop(sessionStorage.scrollTop);
}
});
function myFunction(){
$("form").submit();
}