I need it to change link6/linkr/linkd to "t" using switch based on "checked", switch is working visual correctly but it doesn`t change link6 to "t"
Anyway switch doesn`t change links to "t"
Using debugger i find out that it doesn`t want to trigger, help me make it triggerable
var link6 = "r";
var linkr = "r";
var linkd = "r";
function download74() {
document.getElementById('link1' + link6).click();
}
function download143() {
document.getElementById('link2' + linkr).click();
}
function download198() {
document.getElementById('link3' + linkd).click();
}
function myFunction74() {
if (confirm("Вы собираетесь скачать 74 devblog (RustUP)!")) {
download74();
} else {
return 0;
}
}
function myFunction143() {
if (confirm("Вы собираетесь скачать 143 devblog (Immortal)!")) {
download143();
} else {
return 0;
}
}
function myFunction198() {
if (confirm("Вы собираетесь скачать 198 devblog (TRINITY)!")) {
download198();
} else {
return 0;
}
}
var value = 0;
var checkbox1 = document.getElementById("checkbox1");
checkbox1.checked = value;
document.getElementById("checkbox1").addEventListener("change", function(element){
if (element.checked) {
link6 = "t";
} else {
link6 = "r";
}
});
var checkbox2 = document.getElementById("checkbox2");
checkbox2.checked = value;
debugger;
document.getElementById("checkbox2").addEventListener("change", function(element){
if (element.checked) {
conslose.log("works");
linkr = "t";
} else {
console.log("dont");
linkr = "r";
}
});
var checkbox3 = document.getElementById("checkbox3");
checkbox3.checked = value;
document.getElementById("checkbox3").addEventListener("change", function(element){
if (element.checked) {
linkd = "t";
} else {
linkd = "r";
}
});
```