dojo.addOnLoad( function() { dojo.forEach( dojo.query("span#testButton"),function(x){ dojo.connect( x,"onmouSEOver",null,function(event){x.style.backgroundColor = "green" ;} ); dojo.connect( x,"onmouSEOut",function(event){x.style.backgroundColor = "" ;} ); dojo.connect( x,"onclick",function(event){ alert('-'); } ); dojo.style( x,{ cursor: "default",border: "1px gray solid",padding: "2px",margin: "3px" } ); } ); });