Query element id and add action : query « Dojo toolkit « JavaScript Tutorial






<html>
<head>
<title>Dojo example</title>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
    dojo.addOnLoad(function(){
        dojo.query("#showMe").onclick(function(e){
            var node = e.target;

            var a = dojo.anim(node, {
                backgroundColor: "#ff0",
                color: "#00f"
            }, 1000);

            dojo.connect(a, "onEnd", function(){
                dojo.anim(node, { color: "#0ff" }, null, null, function(){
                    node.innerHTML = "Alert!";
                    dojo.anim(node, { color: "red" });
                });
            });
        });
    });
</script>
<body>
<div id="showMe">
    click me
</div>
</body>
</html>








29.21.query
29.21.1.Query dojo icon class with dojo.query()
29.21.2.Query element id and add action
29.21.3.Query style
29.21.4.Query style from tag
29.21.5.Query to object
29.21.6.Object to query
29.21.7.Get tag by ID and change inner html