zoukankan      html  css  js  c++  java
  • javascript函数

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <!--一、函数-->
    <script>
    function hanshu()
    {
        document.write("欢迎")
    }
    </script>
    
    <!--二、带参数的函数-->
    <script>
    function canshu(txt)
    {
    alert(txt)    
    }
    </script>
    
    <!--三、带返回值的函数-->
    <script>
    function fanhui()
    {
        return ("wwz")
    }
    </script>
    
    <!--四、带有返回值并带有参数的函数-->
    <script>
    function chengfa(a,b)
    {
        return(a*b)
        }
    </script>
    </head>
    
    <body>
    <!--一、函数-->
    <input type="button" onclick="hanshu()" value="调用">
    <!--二 、带参数的函数-->
    <input type="button" onclick="canshu('参数')" value="调用参数">
    <!--三、带返回值的函数-->
    <script>
    document.write(fanhui())
    </script>
    
    <!--四、带有返回值并带有参数的函数-->
    <script>
    document.write(chengfa(5,6))
    </script>
    
    
    </body>
    </html>
  • 相关阅读:
    CentOS7 安装 MySQL 5.7
    Centos7 安装 opencv
    nginx编译支持HTTP2.0
    CentOS 6.5 安装 ffmpeg
    parted 4T磁盘
    nginx upstream
    linux rar 解压忽略带密码压缩包
    那些实用的Nginx规则
    linux 两台服务器共享目录NFS实现
    redis集群搭建
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4484896.html
Copyright © 2011-2022 走看看