I have a javascript variable which I display on my html website, I also have a .txt file which gets a payment value from a .php script. These values are displayed like this 12345 in the .txt file, every amount is raised by 1, so first the .txt file gets 1 then 2 then 3 etc. Now my question is, how do I get the last value from the .txt file and turn my variable value into the value I get, by the last value of the .txt file I mean if the current values in the file is 12345 then the last value is 5, then I want to change the variable in my Javascript to that value 5.
My javascript/html script with the variable and display inside.
<div class="newValue">
Current value: $<span id="newValueVariable"></span>
</div>
<script type="text/javascript">
var newValueVariable= 1;
document.getElementById("newValueVariable").innerHTML = newValueVariable;
</script>
10be appended after 9 (...8910)? In that case would the "last value" be0or10?