I don't know what's wrong here, but what do you think is wrong?
I have this very simple JavaScript function, which, when executed directly to the Inspect Element console works perfectly, but when I bind it to an event, then it returns the error "Uncaught TypeError: object is not a function". What do you think is wrong here?
Here's the function.
var pass_sh_busy = 0;
var pass_sh = function(y) {
if(pass_sh_busy) {
document.getElementById('pass_sh').type = 'password';
document.getElementById('pass_sh').placeholder = '********';
pass_sh_busy = 0;
} else {
pass_sh_busy = 1;
document.getElementById('pass_sh').type = 'text';
document.getElementById('pass_sh').placeholder = 'password';
}
}
pass_sh is this...
<input name="rass" id="pass_sh" placeholder="*********" type="password">
Here's my binded element.
<input style="width:5%" type="button" onclick="pass_sh()">
This is a very weird error I think. What do you think is wrong here?