其他分享
首页 > 其他分享> > Dojo 给 dom 绑定 click 事件

Dojo 给 dom 绑定 click 事件

作者:互联网

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
</head>
<script>var dojoConfig = {async: true}</script>
<script src="dojo/dojo.js"></script>
<script>
    require(["dojo/dom-form", "dojo/on", "dojo/dom", "dojo/domReady!"], function (domForm, on, dom) {
        on(dom.byId("domNode"), "click", function () {
            console.log('这是一个示例');
        })
    })
</script>
<style>
    form {
        border: 1px solid black;
    }
</style>
<body>
<form id="yourForm">
    <label>账号:</label><input type="text" name="account"/><br>
    <label>密码:</label><input type="password" name="password"/><br>
    <input id="domNode" type="button" value="点击提交并显示你输入的内容"/>
</form>
</body>
</html>

  

标签:function,Dojo,form,dom,示例,dojo,click
来源: https://www.cnblogs.com/backhas/p/14961753.html