DISABLED AND ENABLED DIV CHILD ELEMENT USING JQUERY

WRITE FOLLOWING CODE IN YOUR SCRIPT FOR DISABLE A DIV :

$('#DIVID').find("*").prop("disabled", true);

WRITE FOLLOWING CODE IN YOUR SCRIPT FOR ENABLE A DIV :

$('#DIVID').find("*").prop("disabled", false);



'DIVID' is the id of your div element.Here find("*") used for to get all child element or controls. and "disabled" is a property of div tag. if 'disabled' is true then the div will disabled and child elements also disabled or if it is false then the div will enable and the child elements also enabled.


WRITE FOLLOWING CODE IN YOUR SCRIPT FOR DISABLE A SINGLE CONTROL :

$('#TXTID').prop("disabled", true);

WRITE FOLLOWING CODE IN YOUR SCRIPT FOR ENABLE A SINGLE CONTROL  :

$('#TXTID').prop("disabled", false);

Post a Comment

0 Comments