jQuery javascript make an input readonly

To make an input readonly, simply use .prop

	$("#fieldName").prop("readonly", true);

To enable the input

	$("#fieldName").prop("readonly", false);

By Keenlio, May 9, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

six + = 8

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>