Wednesday, April 29, 2009

Enabled/Disable HTML Elements


function EnableDisabled(elName)
{
var el = document.getElementById(elName);
if(el){
try {el.disabled = el.disabled ? false : true;}
catch(ex){}

if (el.childNodes && el.childNodes.length > 0)
{
for (var x = 0; x < el.childNodes.length; x++)
{
EnableDisabled(el.childNodes[x]);
}
}
}
}

No comments:

Post a Comment