I’m using jQuery to add a readonly attribute to all form elements but can’t seem to figure out how to do this.
Here is what I’m trying:
$('#form1').each( function() { $(this).attr('readonly', true); });
I have a simple form using label/input to display form elements.
Also I’m using tipsy (Tool tip plug-in) as well as Formalize (Look and Feel Plug-in)
Try this:
#form1 input, #form1 textarea, #form1 selectattrwould work for a collection same as for a single element.#form1matched just the<form>element, andeachwas triggered once, for that element. To find all elements (input or not), you can write#form1 *.