Loop executes this function, why the value obtained is not accumulated

wants to change the opacity, of the element by constantly executing the timer, but only the opacity of the element obtained by the function each time is 0, which is not accumulated. The code is as follows:
function appear () {

   var opity = document.getElementById("fade-obj").style.opacity;  
   console.log(document.getElementById("fade-obj").style.opacity);    
    if(opity != 1) {   
        document.getElementById("fade-btn").disabled = "true";          
        opity += 0.2;
        document.getElementById("fade-obj").style.opacity = opity;
        setTimeout(appear,500);
    }else{
        document.getElementById("fade-btn").innerHTML = "";
        document.getElementById("fade-btn").removeAttribute("disabled");
    }
}
document.getElementById("fade-btn").addEventListener("click", function() {
      if (document.getElementById("fade-btn").innerHTML == "") {
        setTimeout(appear,500);
    }
}, false)

the results are as follows:

clipboard.png
I don"t know why the value of document.getElementById ("fade-obj") .style.opacity remains the same

Mar.21,2021

var opity = document.getElementById ('fade-obj'). Style.opacity
the value taken here is of string type
and then the + = becomes 0.20.2


var opity = document.getElementById('fade-obj').style.opacity;
//opity '0.2'
opity += 0.2; // '0.20.2'
document.getElementById('fade-obj').style.opacity = opity;
document.getElementById('fade-obj').style.opacity // 0.2
We must pay attention to the plus sign operation of

string!


in fact, you can debug and see it yourself, and you are more impressed than others to give you the answer directly

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4c0e1-44e97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4c0e1-44e97.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?