2 回答

TA貢獻1856條經驗 獲得超5個贊
您應該比較內容而不是元素。另外,不確定您要做什么:
symbol = String(symbol);
嘗試
var price = document.getElementById("price");
var symbol = document.getElementById("symbol");
if (currencyy == "lbp") {
if (symbol.textContent == "$") { //compare the content
symbol.textContent = "lbp";
var text = price.textContent;
var number = parseInt(text) * 2000;
price.textContent = number;
}
}
}

TA貢獻1803條經驗 獲得超3個贊
<ng-template [ngIf]="isStatusCode[j] === false">
<img class="list-image" (error)="changeImgSource($event)" [src]="getConfigProductImage(element['shrt-campaign-product'][0]['products']['product_images'])" height="40"
alt="productImage">
</ng-template>
<ng-template [ngIf]="isStatusCode[j] === true">
<img class="list-image" (error)="changeImgSource($event)" src="/assets/images/loader.gif" height="60" alt="noImage">
</ng-template>
添加回答
舉報