zoukankan      html  css  js  c++  java
  • dojo-复选框

    1、问题背景

         设计一组复选框,并获取复选框的值


    2、实现源码

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>dojo-复选框</title>
    		<link rel="stylesheet" href="../js/dojo-release-1.11.1-src/dijit/themes/claro/claro.css" />
    		<script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
    		<script type="text/javascript" src="../js/dojo-release-1.11.1-src/dojo/dojo.js"></script>
    		<style>
    			body,html{
    				 99%;
    				height: 99%;
    				font-family: "微软雅黑";
    				font-size: 12px;
    				overflow: hidden;
    			}
    		</style>
    		<script>  
                dojoConfig={async:true,parseOnLoad:true}  
            </script> 
    		<script>
    			require(["dijit/form/CheckBox", "dojo/domReady!"], function(CheckBox){
    			    var checkBox = new CheckBox({
    			        name: "checkBox",
    			        value: "男",
    			        checked: false,
    			        onChange: function(b){ 
    			        	alert(this.get('value') ); 
    			        }
    			    }, "man").startup();
    			   
    			   var checkBox1 = new CheckBox({
    			        name: "checkBox",
    			        value: "女",
    			        checked: false,
    			        onChange: function(b){ 
    			        	alert(this.get('value') ); 
    			        }
    			    }, "woman").startup();
    			});
    		</script>
    	</head>
    	<body class="claro">
    		<input id="man" /> 
    		<label for="man">男</label>
    		<input id="woman" /> 
    		<label for="woman">女</label>
    	</body>
    </html>
    

    3、实现结果

    (1)当勾选“男”时


    (2)当勾选“女”时


  • 相关阅读:
    jar 常用操作
    linux 加载新的磁盘(卷组)
    apache 代理配置
    spring boot datasource 参数设置
    svn 常用命令
    最详细的maven教程
    centos 用户组操作
    ubuntu命令行操作mysql常用操作
    Ruby-Clamp
    maven使用备忘
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314117.html
Copyright © 2011-2022 走看看