In the sequence you run the code, isn't that correct? You seem to get
myText1 from the div, stick that in the textbox, and then insert the value into
demo_score after that. If you want that value, surely you'll need to move the sequence so that the textbox isn't populated until after you've put the correct value into the div?