An input element on a web page is defined like the following to prevent passwords being pasted in:
<input type="password" class="field" id="password" name="password" title="Enter your password" maxlength="50" onpaste="javascript:return false;" size="38" tabindex="2">
I want to enable pasting in this input field. Using Firebug or equivalent I can edit the onpaste function so the code is:
onpaste="javascript:return true;"
This is fine for me, but for other users, I want a simpler solution. What came to mind is that if I could give them some Javascript, they could open the console and paste in a simple one-liner. However when I tried to do this the Javascript had no effect. I tried the following and neither worked.
$('#password').onpaste=""
$('#password').onpaste="javascript:return true;"
What am I doing wrong?