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

tile-list and onclick event

Hi! I have created a tile-list and now i want to click item1 and for example it will show my daily steps.Have anyone any idea of how can i connect my list and click the item1? 

 

//index.gui

<use id="my-list" href="#tile-list">

 <use href="#my-tile-item" class="tile-list-item">
<set href="text" attributeName="text-buffer" to="Steps" />
</use>

 

//index.js

let list = document.getElementById("my-list");
let items = list.getElementsByClassName("tile-list-item");

items.forEach((element, index) => {
let touch = element.getElementById("touch-me");
touch.onclick = (evt) => {
console.log(`touched: ${index}`);
}
});

 

Best Answer
0 Votes
1 REPLY 1

Wondering why you deleted your account before someone could help you out. I can't help you, but you posted in the area where the smart tech developer types reside. Sorry you couldn't wait - it's been three hours and it's a weekend. You won't get notice if anyone does post here, since you deleted your account. 

Stepping in the U.S.A. since September 2013. Android 14

Best Answer
0 Votes