Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to make the text on a clock face appear when a button is clicked?

ANSWERED

HI, I have managed to put the buttons onto the clock face & get a console log when the button is clicked, with an event listener.

Is there any way to make the text appear and then be replaced when another button is clicked?

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Something like this:

 

 

<svg>
  <text id="demo" style="display:none">Hello!</text>
</svg>

 

 

 

import document from "document";

let demo = document.getElementById("demo");

// do this in the click event
demo.text = "Hello World!";
demo.style.display = "inline";

 

 

https://dev.fitbit.com/build/guides/user-interface/javascript/

 

https://dev.fitbit.com/build/guides/user-interface/javascript/#click-event

 

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

Something like this:

 

 

<svg>
  <text id="demo" style="display:none">Hello!</text>
</svg>

 

 

 

import document from "document";

let demo = document.getElementById("demo");

// do this in the click event
demo.text = "Hello World!";
demo.style.display = "inline";

 

 

https://dev.fitbit.com/build/guides/user-interface/javascript/

 

https://dev.fitbit.com/build/guides/user-interface/javascript/#click-event

 

Best Answer
0 Votes