我收到语法错误
Uncaught SyntaxError: missing ) after argument list
我的代码
<button onclick="alert('document.getElementById('todo.age').value');">onclick</button>
最佳答案
在 Controller 中添加
$scope.alert = function(age) {
alert(age);
}
在 html 中更改如下:
<button ng-click="alert(todo.age);">onclick</button>
关于javascript - JavaScript 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30451562/