首页 > 解决方案 > 我无法弄清楚以下函数的字符串返回

问题描述

tin.onchange = addNewValue;

      function addNewValue(e){
          c1 = e.target.value;
        console.log(c1);
           return c1;
       }

            
       tin2.onchange = addNewValue2;
       function addNewValue2(f){
          c2 = f.target.value;
          return c2;
       }
       line2 = c1 + c2;
        ;
        console.log(line2);

我试图让通过动态出现的表单填充用户的变量返回到我可以添加到原始字符串的字符串。但是它们之间的链接不起作用。

我错过了什么?

标签: javascriptstringreturn

解决方案


推荐阅读