Please help me for change data of var element with JavaScript. I can't. I need If check.innerText changed to need change phone number.
function call(){
var check = document.getElementById("locinfo").innerText;
var tellnum = "tel:+998951441000";
if (check=="Катартал") {
tellnum = "tel:+998998047911";
}
else if (check=="Куйлик") {
tellnum = "tel:+998951440010";
} }
window.location.href = tellnum;
}
It's seem like you have one spare },
this should work.
function call(){
var check = document.getElementById("locinfo").innerText;
var tellnum = "tel:+998951441000";
if (check=="Катартал") {
tellnum = "tel:+998998047911";
}
else if (check=="Куйлик") {
tellnum = "tel:+998951440010";
}
window.location.href = tellnum;
}