i have coded a script that should refresh the page for Number of times the user input the value . here is the code
Can u try using this instead.
if (reloadCnt <= document.getElementById('a').value;)