Enabling or disabling form elements


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //To disable a form element such as a text input field
  2. $("#myelement").attr("disabled", "disabled");
  3.  
  4. //To re-enable a disabled form element
  5. $("#myelement").removeAttr("disabled");
  6.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.