Skip to content

Commit 8b73679

Browse files
committed
Added getLabel() and setLabel() to the Button
1 parent 3f83c24 commit 8b73679

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/button/Button.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,30 @@ javaxt.dhtml.Button = function(parent, config) {
498498
//**************************************************************************
499499
//** getText
500500
//**************************************************************************
501-
/** Returns the button label.
501+
/** Returns the button label. Same as getLabel().
502502
*/
503503
this.getText = function(){
504-
return label.innerHTML;
504+
return me.getLabel();
505+
};
506+
507+
508+
//**************************************************************************
509+
//** getLabel
510+
//**************************************************************************
511+
/** Returns the button label.
512+
*/
513+
this.getLabel = function(){
514+
return label.innerText;
515+
};
516+
517+
518+
//**************************************************************************
519+
//** setLabel
520+
//**************************************************************************
521+
/** Used to update the button label.
522+
*/
523+
this.setLabel = function(str){
524+
label.innerText = str+"";
505525
};
506526

507527

0 commit comments

Comments
 (0)