i have coded a script that should refresh the page for Number of times the user input the value . here is the code
I agree with Matt Morgan that your attempt to assign a variable inside a conditional:
if ( reloadCnt <= var x = document.getElementById('a').value; )
probably means you need to brush up on your understanding before proceeding.
But here is a working demo for you. (Not having your index.php, which I assume populates the textbox "a", I've done it client-side and fetched the posted value from the querystring. Once you've got it working, you can always revert to document.getElementById('a').value
)
You'll also want to clear your sessionStorage variable when the user next hits the page, otherwise when you try to test it twice in a row, reloadCounter will still be where it was at the end of the last run.