El botón funciona bien en mi editor de código, pero cuando subo todo el paquete a las extensiones de Chrome, la función no se activa.
aquí está el js:
const netProfit = document.getElementById("netprofit") const btn = document.querySelector("button") const gg = document.getElementById("gg") btn.addEventListener("click", function() { const buyPrice = document.getElementById("buyprice").value const sellPrice = document.getElementById("sellprice").value const royalty = document.getElementById("royalty").value const serviceFee = document.getElementById("servicefee").value const buyGas = document.getElementById("buygas").value const sellGas = document.getElementById("sellgas").value const img = document.querySelector("img") let profitCal = ((100 - royalty - serviceFee) * 0.01) profitCal = (sellPrice * profitCal) - buyPrice - buyGas - sellGas //no annoying 0.0000 if (profitCal != 0) { netProfit.textContent = profitCal.toFixed(5) } else { netProfit.textContent = profitCal } if (profitCal >= 0.1) { img.style.display = "block" } else { img.style.display = "none" } })