automatically add onclick functions to newly added stock crypto li items

This commit is contained in:
Justin
2023-07-11 17:37:21 +08:00
committed by GitHub
parent 73a3220fb8
commit a627bf7f21

View File

@@ -929,7 +929,13 @@ allFeaturesTextAddBtn.map((value, index) => {
var tag = document.createElement("li"); var tag = document.createElement("li");
if (index == 2) { if (index == 2) {
tag.innerHTML= document.getElementById("base-select").value + ',' + document.getElementById("quote-select").value; tag.innerHTML= document.getElementById("base-select").value + ',' + document.getElementById("quote-select").value;
} else{ } else if (index == 0) {
tag.innerHTML = allFeaturesText[index].value;
tag.setAttribute("onclick", "getStockSymbol(this.innerText)");
} else if (index == 1) {
tag.innerHTML = allFeaturesText[index].value;
tag.setAttribute("onclick", "getCryptoSymbol(this.innerText)");
} else {
tag.innerHTML = allFeaturesText[index].value; tag.innerHTML = allFeaturesText[index].value;
} }
allFeatures[index].appendChild(tag); allFeatures[index].appendChild(tag);