How to append a string value during assignment in Javascript?

前端 未结 7 1064
故里飘歌
故里飘歌 2020-12-10 08:04

Hey i dont know if that is possible but i want to set a given variable in js by reference.

What i want to do is, that each time i pass a string to t

7条回答
  •  独厮守ぢ
    2020-12-10 09:00

    If its a reference to an input text filed then you can use the value property

    function addstring(string)
    {
        document.getElementById("string").value += string.value;
    
    }
    

    See value

提交回复
热议问题