How to enable input onclick?

Posted by MID on Stack Overflow See other posts from Stack Overflow or by MID
Published on 2012-08-30T09:35:28Z Indexed on 2012/08/30 9:38 UTC
Read the original article Hit count: 167

Filed under:
|

My input is disabled on default and I want ot enable it onclick on some reference.

Here is my HTML:

  <div class="field2">
  <p><b>PayPal account email</b></p>
 <input autocomplete="on" disabled="disabled" id="user_paypal_email"
name="user[paypal_email]" size="30" type="email" value="111">
<a href="/users/edit.6" id="#edit_email">Edit</a>
  </div>

and tried this js:

$("#edit_email").click(function() {
$("#user_paypal_email").removeAttr("disabled");
 });

but it doesn't work. Can someone suggest solution ?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html