The button that I'm working on, when clicked, pans a div to the left. In the script, the "if" condition works fine but the "if else" condition doesn't.
Did I forgot something to include in the script?
here's my script:
<script>
function panleft(el){
var elem = document.getElementById(el);
if (elem.style.left = "90%"){
elem.style.transition = "left 0.3s ease-in 0s";
elem.style.left = "70%";
}
else if (elem.style.left = "70%"){
elem.style.transition = "left 0.3s ease-in 0s";
elem.style.left = "90%"
}
}
</script>
=and==and===?