Javascirpt - 事件

来源:互联网 发布:js trim函数使用 编辑:程序博客网 时间:2024/04/29 21:44

这里写图片描述

<html><head>   <script type="text/javascript">      function add2(){        var numa,numb,sum;        numa=6;        numb=8;        sum=numa+numb;        document.write("两数和为:"+sum);  }   </script></head><body>   <form>      <input name="button" type="button" value="点击提交" **onclick="add2()"** />   </form></body></html>
0 0