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

Is it possible to trigger onclick event without button component?

Is it possible to trigger onclick event without button component? I want to trigger click event when user press custom circle.

 

For example 

 

//index.gui

<circle id="btn" cx="75" cy="230" r="50" fill="red" />

 

//index.js

const btn = document.getElementById("btn");

btn.addEventListener("click", () => {
  console.log('XXXXXXXXXXXXX');
});

Best Answer
0 Votes
4 REPLIES 4

Hi @talantbekov_k 

 

Are you building an application for the smart watch (Ionic and Versa family) using the Device SDK?  I want to make certain your question is in the correct forum room.

 

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes
Yes, I'm building an application using the Device SDK.
Best Answer
0 Votes

You could just be missing

pointer-events="visible"

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

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thank you, @talantbekov_k .  I'm going to move your post to the SDK Development forum.  Someone there should be able to help you.

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes