I’m trying to use a hidden form value as a counter for some Javascript actions. (I.e. something different will happen the second time a user clicks on a spot than the first time.) But code like:
<input type="hidden" id="foo" value=0>
interprets the initial value as the string ‘0’. Is there a way to specify I want the value to be an integer, or do I just have to convert the string to an integer later?
You’ll have to do it later, I’m afraid. The value will always be a string. Some libraries might intelligently cast it for you but originally yes, it’s a string.