I am very new to JS and trying to get my head around how to change values of a span using JS. So, I have a span looking like this:
<span id="s551392614400915" class="vote-count-post" value="551392614400915">0.31</span>
I would like to change the 0.31 to say 150 - and Iam trying to use the getElementById as follows:
var xx=150;
document.getElementById("s551392614400915").value = "150"; //dosent work.
//document.getElementById("s551392614400915").value = xx; //dosent work.
for some reason this does not seem to work. I know I am doing something completely stupid, but I am unable to see where. Here is my rather silly JS Fiddle
any help with this would be great.
spanelements don't havevalueattributes