1 month ago

How to assign value to global variable outsie of a function

Posted 1 month ago by Azeem812

var MyTotal

function calculateTotal(no){

                var price=document.getElementById("price"+no).value;
                var qty=document.getElementById("qty"+no).value;
                var total=price*qty; 
                return total;

i want to assign total variable value to MyTotal variable,how do this?

Please sign in or create an account to participate in this conversation.