Another issue need solution

i have this code which copies value in div to text field but the value doesnt copy instead i getDisplay the result here what am i doing wrong but still display the right value in div

<div class="myDiv1" id="demo_score">Display the result here.</div>
<input type="text" value="" id="myTextBox1" />
 
<script>
var myTextBox1 = $("#myTextBox1");
var myText1 = $(".myDiv1").text();
myTextBox1.val(myText1);
document.getElementById("demo_score").innerHTML = ({BIDTOTAL} / {TOTALUSER1} * {HOUSE_COMMISSION} > {MIN_BIDS}) ? '<div id="high"></div>' : '<div id="low"></div>';

</script>


<script>
var x = ( {BIDTOTAL} / {TOTALUSER1} ) * {HOUSE_COMMISSION} ;
document.getElementById("high").innerHTML = x;
</script>
    
<script>
var x = {MIN_BIDS} ;
document.getElementById("low").innerHTML = x;
</script> 


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?

Let’s keep all the discussions in one place, shall we? You’re going to end up with potentially conflicting answers - at the very least you’ll have a hard time keeping them straight…

THREAD CLOSED