Asp.Net Script的价格变化工作良好的IE,但不是在Chrome或Firefox

Asp.Net Script for price change works fine in IE, But not in Chrome or Firefox

本文关键字:Chrome Firefox IE Script Net 变化 工作 Asp      更新时间:2023-09-26

以下PriceChange脚本在Internet Explorer中可以正常工作,但在任何其他浏览器中都不能正常工作。你能帮帮我吗?

case 'A':   document.getElementById("cs_priceinr").value=price;
            if(price<=100)
            {
                document.getElementById("cs_priceusd").value = 2.50;
                document.getElementById("cs_usdair").value = 6.95;
            }
            else
            {
                document.getElementById("cs_priceusd").value = Math.round((price/40.00)*100)/100;
                if(price<=250)
                    document.getElementById("cs_usdair").value = Math.round((price/15)*100)/100;
                else if(price<=500)
                    document.getElementById("cs_usdair").value = Math.round((price/16)*100)/100;
                else if(price<=750)
                    document.getElementById("cs_usdair").value = Math.round((price/17)*100)/100;
                else
                    document.getElementById("cs_usdair").value = Math.round((price/18)*100)/100;
            }
            break;

textContentnodeValue代替value

value属性似乎不是标准的:

  • https://developer.mozilla.org/en-US/docs/Web/API/Node
  • https://developer.mozilla.org/en-US/docs/Web/API/Element