disable/enable an element in jquery?

January 20, 2010 | Filed Under JQuery | Comments Off

you can disable/enable web element using attr and removeAttr functions respectively

// Disable #x
$(“#x”).attr(“disabled”,”disabled”);
// Enable #x
$(“#x”).removeAttr(“disabled”);

Example:

type=”button” value=”Disable” onclick=”$(‘#x’).attr(‘disabled’,'disabled’)”/>

Comments

Comments are closed.

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker