小编Vid*_*val的帖子

包括javascript到谷歌网站

我正在尝试将一个简单的JavaScript添加到Google协作平台,但按下按钮时我什么都没得到.我把代码放在HTML Box中.在本地测试时,代码可以正常工作.这是我的代码:

<script>
  function calcul(){
    x = parseFloat(document.getElementById("value1").value);
    y = parseFloat(document.getElementById("value2").value);
    document.getElementById("answer").innerHTML=x+y;
  }
</script>

<form action="" id="nothing">
  <input type="text" id="value1">
  <input type="text" id="value2">
<input type="button" value="Calculate" id="but" onclick="calcul()" />

<p id="answer"></p>
Run Code Online (Sandbox Code Playgroud)

有什么东西我忘了让它起作用吗?

javascript google-sites html-box-gadget

6
推荐指数
1
解决办法
8816
查看次数

标签 统计

google-sites ×1

html-box-gadget ×1

javascript ×1