Dashcode newbie: Change a button's label programmatically
-
11-09-2019 - |
Question
I'm new to Mac OS X Dashboard developement. Now, I have a button with id b_start. When that button is clicked, I want the label of the button to change to "Round".
Now I have tried these, but none of them work:
document.getElementById("b_start").label = "Round";
document.getElementById("b_start").text = "Round";
document.getElementById("b_start").innerText = "Round";
document.getElementById("b_start").object.setValue("Round");
document.getElementById("b_start").value = "Round";
Does anyone how I can change the button's label?
Solution
I solved the question my own. Just use this:
document.getElementById("b_start").object.textElement.innerText = "Round";
OTHER TIPS
document.getElementById("b_start").object.setText("Round");
document.getElementById("b_start").object.setEnabled(false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow