I am having two questions with respect to this above program
-
The Width of the button is appearing very small
-
How can I change the color of the button programatically means onclick of this button I have a function?
dojo.setStyle(“bid” ,”color” ,”red”);
But both aren’t working
<html>
<head>
<link rel="stylesheet" type="text/css"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"
djConfig="parseOnLoad: true">
</script>
<script>
dojo.require("dijit.form.Button");
</script>
</head>
<body class="claro">
<div dojoType="dijit.form.Button" id="bid" style="color: green;width: 335px; font-size:12px;"></div>Save
</body>
</html>
The method you want is style, not setStyle, so use:
To make the button bigger, put some text in the div: