How can i make a disabled control back to enable using Javascript
<p>I have done a code to disable a control when user clicks on a control. On my form i am having a <code>TextBox</code> and a <code>DropDown</code>. When user clicks on a <code>TextBox</code> i will <code>disable</code> the <code>DropDown</code> like that when click on <code>DropDown</code> i will disable the <code>TextBox</code> which works fine.</p>

<p>But when the user clicks on <code>Disabled</code> control i would like to enable that control. Means if i click on <code>TextBox</code> which was disabled i would like to <code>Enable</code> it like that for <code>dropdown</code> too..</p>

<p>My sample Script is as follows</p>

<pre><code>&lt;script type="text/javascript"&gt;

function toggleDropDownList1()
{
var d=document.getElementById("&lt;%= DropDownList4.ClientID %&gt;");
if(d.disabled)
{
d.disabled=false;
}
else
{
 document.getElementById("&lt;%= TextBox1.ClientID %&gt;").disabled = true;
}
}
function toggleDropDownList2()
{
 document.getElementById("&lt;%= DropDownList4.ClientID %&gt;").disabled = true;
}
&lt;/script&gt;
</code></pre>

<p>Design</p>

<pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" onclick="toggleDropDownList2();"&gt;&lt;/asp:TextBox&gt;
        &lt;asp:DropDownList ID="DropDownList4" runat="server" onclick="toggleDropDownList1();"&gt;
            &lt;asp:ListItem Text="One" Value="1"&gt;&lt;/asp:ListItem&gt;
            &lt;asp:ListItem Text="One" Value="1"&gt;&lt;/asp:ListItem&gt;
        &lt;/asp:DropDownList&gt;
</code></pre>
