Current location - Recipe Complete Network - Health preserving recipes - Please explain that this is a calculator software written in JAVASCRIPT. Please help us to see what this function means in detail.
Please explain that this is a calculator software written in JAVASCRIPT. Please help us to see what this function means in detail.
Functional text (v)

{

var a = document . getelementbyid(" test input ")。 Value; //Get the value of the text box

If (flange & amp & oper! Do nothing when the = "=" {}//operator is not =

Else // When clicked =

{

flang = true

If('+'==oper) // operator is+.

{

total = parse float(total)+pares float(a); //The last saved value plus the value of the text box should add up to the one I explained in my last question.

}

Else if('-'==oper){ // followed by-*/Tongli.

total-= a;

}

else if('*'==oper){

total * = a;

}

else if('/'==oper){

total/= a;

}

other

{

Total = a;;

}

document . getelementbyid(" test input ")。 Value = total; //Then put the operation result into the text box.

oper = v; //operator flag redistribution

}

}

The whole method is that when you click =, the last saved input value (understood as dividend is subtracted, etc.) is operated with the second input value.