I am facing a drop down disabling problem here . I have two conditions here, cond1 and cond2 .If its the cond1 i will disable my drop down menu, else i will enable it.
This is what i fished out :
if(cond1)
{
DP1.setAttribute('disabled', 'disabled');
}
else
{
DP1.setAttribute('disabled', false);
}
The problem is once the drop down gets disabled , its not getting enabled again . For eg if its cond2 , then it must be enabled . What am i doing wrong ? Kindly suggest some solution to this.
I suppose
removeAttributewould do the trick:DP1.removeAttribute('disabled');Here’s a jsfiddle, using that