【发布时间】:2016-06-15 19:35:09
【问题描述】:
谁能告诉我用这个 js 实现 here 的相同目标的最佳方法是什么:
function ContactController($scope) {
$scope.contacts = ["hi@me.no", "hi@you.com"];
$scope.addMail = function() {
if(this.mailAdress) {
$scope.contacts.push($scope.mailAdress);
$scope.mailAdress = "";
}
};
}
不使用 Angular。我只是想了解如何使用 javascript 将用户输入保存到 DOM。谢谢!
【问题讨论】:
标签: javascript html dom submit frontend