JavaScript
Article

jQuery check if field is read only

By Sam Deering

A jQuery code snippet to check if field is read only.

//if field is not read only
if($(this).attr('disabled'))
{
  ...
}
  • Erik Roznbeker

    Also, if($(this).attr('readonly')) is good to check…

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.