美文网首页
2018-07-02

2018-07-02

作者: 枫叶落尽 | 来源:发表于2018-07-02 01:03 被阅读0次

    p14

    <script>
    "use strict"; // 启用 ECMAScript 5 严格模式
    /*
    * This script defines the calculate() function called by the event handlers
    脚本定义了会在上面的HTML中事件处理所调用的calculate函数
    * in HTML above. The function reads values from <input> elements, calculates
    这个函数从<input>元素中读取值,计算贷款还款信息,然后将结果显示在<span> 元素中
    * loan payment information, displays the results in <span> elements. It also
    * saves the user's data, displays links to lenders, and draws a chart.
    它还保存用户的数据,显示贷方的链接,然后画出一个表格
    */
    function calculate() {
    // Look up the input and output elements in the document
    //查找、获得input和output元素
    var amount = document.getElementById("amount");
    var apr = document.getElementById("apr");
    var years = document.getElementById("years");
    var zipcode = document.getElementById("zipcode");
    var payment = document.getElementById("payment");
    var total = document.getElementById("total");
    var totalinterest = document.getElementById("totalinterest");
    // Get the user's input from the input elements. Assume it is all valid.
    //获取用户输入数据,假设全是合法的数据
    
    

    相关文章

      网友评论

          本文标题:2018-07-02

          本文链接:https://www.haomeiwen.com/subject/yqqkuftx.html