Uncaught TypeError: Object is not an onclick function
I am getting the error "Uncaught TypeError: object is not a function" when clicking on a button on my web page.
Button code:
<button id="addUser" name="addUser" onclick="addUser()"> Add User </button>
Code for the addUser function
function addUser() {
userValue = document.getElementById("userForAdmin");
passValue = document.getElementById("passForAdmin");
console.log(userValue.value);
console.log(passValue.value);
}
Can anyone please point out my error? I guess this is probably the main mistake.
+3
source to share