javascript - How to disable/enable input field on click with jQuery -


how enable/disable input field on click jquery?

i experimenting with:

$("#fullname").removeattr('disabled'); 

which removes disabled="disabled" input field:

<input id="fullname" style="width: 299px" value="marko" disabled="disabled" /> 

but how add again click on button or how disable input field on click?

for jquery version 1.6+ use prop:

$('#elementid').click(function(){         $('#fullname').prop('disabled', true\false); }); 

for older versions of jquery use attr:

$('#elementid').click(function(){         $('#fullname').attr('disabled', 'disabled'\''); }); 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -