Style to a Button

27 views
Skip to first unread message

siddharth trikha

unread,
May 23, 2012, 4:20:57 AM5/23/12
to Closure Library Discuss
I am trying to implement button dynamically.
Here is my code:
.............
var button = new goog.ui.Button('Hello!');
button.render(goog.dom.getElement('buttonDiv')); // button div in
HTML

button.addClassName('className');
button.setId('idName');

.............
the contents of my css file are:
.............
.className {
background-color:red;
}
#idName {
color:blue;
}
.............
The style corresponding to class is working while the one with id is
not working. Is it that 'setId' used is wrong?
Help!
Reply all
Reply to author
Forward
0 new messages