i have coded a script that should refresh the page for Number of times the user input the value . here is the code
You have a some fundamental problems with your JavaScript. It's important that you understand why this is not working if you want to be able to use JS well in the future.
This statement is not doing what you intend:
if ( reloadCnt <= var x = document.getElementById('a').value; )
You are saying "if reloadCnt is less than or equal to some thing" where "some thing" is the result of the statement:
var x = document.getElementById('a').value;
This statement is assigning document.getElementById('a').value to the variable x. The return value of such an assignment is always undefined in JavaScript. This means what you've effectively written is the same as:
if ( reloadCnt <= undefined )
This is always going to be false, which is why it's not working for you.
There are two other issues:
Your jQuery lookup will return a string, which you should convert to a number before comparing it to another number.
You don't need a semicolon inside your conditional.
In the end, this is probably what you want to write:
if (reloadCnt <= Number(document.getElementById('a').value)) { ... }