现在的位置: 首页 > 综合 > 正文

js common

2013年06月04日 ⁄ 综合 ⁄ 共 528字 ⁄ 字号 评论关闭

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
    <script language="javascript">
      function calc(){
          alert("12.345"+2);
          alert(parseInt("12.345")+2);
          alert(parseFloat("12.345")+2);
          alert("12.345".length);
          var arr=['ab','cd','efg'];
          alert(arr.length);
      }
   
    </script>
</head>
<body>
<input  type="button" value="计算" onclick="calc()" />
</body>
</html>

抱歉!评论已关闭.