In your conditions you are using a single equal!!!
Therefore, it is a assignation operation that is done instead of comparison! So you are not checking that your variable is equal to true but you are assigning it to true and since your assignement operation was successful your condition is at the same time fulfilled.
Change it with two or tree equals ==
or ===
instead of =
Usage and differences between ==
and ===
are explained very well here:
Which equals operator (== vs ===) should be used in JavaScript comparisons?