使用JavaScript中的onclick函数(使用原型)将数据添加到表中

时间:2019-02-02 15:39:08

标签: html html-table

data(mtcars)
map(mget(c("mtcars", "mtcars")), ~ .x %>%
                                  select(mpg:drat))
window.onload = function () {
    //var Students = new Array;
    var Student = function (firstName, lastName, Rating) {
        this.number = number;
        this.firstName = firstName;
        this.lastName = lastName;
        this.Rating = Rating;
        // (function(){return this.number++})()

    }
    .prototype.setParams = function () {
        var prevFirstName = document.querySelector("#firstNameInput");
        this.firstName = prevFirstName.value;
        var prevLastName = document.querySelector("#LastNameInput");
        this.LastName = prevLastName.value;
        var prevRating = document.querySelector("#ratingInput");
        this.Rating = prevRating.value;
    }
}

现在我要做的是此代码中有两个按钮。添加和删​​除。我已经编写了上面的代码来添加数据,但是当我单击添加时,数据不会添加到表主体中。我使用的onclick函数添加data.Need帮助这一点。

0 个答案:

没有答案