Enable Div from UI using script and Disable it from server side

I am working on a pagination requirement
when user clicks the next page I am disabling pagination button(stopping it from click before loading results), using javascript function on client side and trying to enabling it from the server side
it is not overwriting my server side style with client side style
this is my client side code
this.shadowRoot.getElementById(‘checkNextPage’).style.display = ‘none’;
this is my server side code
can you please help me