So I am using onclick to detect clicks on my text and execute functions from within my main.js file. On the web emulator, this all works fine but when I port it to my watch and click the text it just vibrates and does nothing. The code below does add a point when I click the text in the emulator but not on the watch itself. Thanks in advance.
HTML: h1 id=“team1Three” onclick=“add1Team1()” style=“position:absolute; left:70.9px; bottom:205px; width:110px; Height:80px; text-align:centre;”>CBH
JS:
let numTeam1 = 0;
let totalTeam1 = 0;
function KeyUpTeam1() {
totalTeam1 = numTeam1 += 1;
changeTextTeam1();
}
function changeTextTeam1() {
document.getElementById(“scoreTeam1”).innerHTML = totalTeam1;
if (totalTeam1 > 9) {
document.getElementById(“scoreTeam1”).style.left = “150px”;
document.getElementById(“scoreTeam1”).style.bottom = “193px”;
console.log(“More Than 9”);
}
if (totalTeam1 < 10) {
document.getElementById("scoreTeam1").style.left = "70.9px";
document.getElementById("scoreTeam1").style.bottom = "205px";
console.log("Less Than 10");
}
}
function add1Team1() { //key press subtract
totalTeam1 = numTeam1 += 1;
changeTextTeam1();
}
let numTeam2 = 0;
let totalTeam2 = 0;
function KeyUpTeam2() {
totalTeam2 = numTeam2 += 1;
changeTextTeam2();
}
function changeTextTeam2() {
document.getElementById("scoreTeam2").innerHTML = totalTeam2;
}
function add1Team2() { //key press subtract
totalTeam2 = numTeam2 += 1;
changeTextTeam2();
}