Removing READONLY attribute from textbox using client side code
<p>I have a multiline textbox that by default, is set to ReadOnly. I would like a button on the page to change the control to allow it to be edited. I would like this code to run on the client side because the page renders slowly and I'd like to avoid the post back. </p>

<p>The problem I'm having is the javascript code that I wrote to remove the readonly attribute appears to have no effect. I posted a stripped down example that illustrates the problem for your review. </p>

<pre><code>&lt;%@ Page Language="C#" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;script runat="server"&gt;

&lt;/script&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;Test&lt;/title&gt;
    &lt;script  type="text/javascript" language="javascript"&gt;
    function EnableEditing() {
    var e = document.getElementById("&lt;%=TextBox1.ClientID%&gt;");
        var result = e.removeAttribute("readonly");
        alert(result);

    }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;     &lt;/div&gt;
&lt;asp:TextBox ID="TextBox1" runat="server" ReadOnly="True" TextMode="MultiLine"&gt;test&lt;/asp:TextBox&gt;        
        &lt;input id="Button1"  onclick="EnableEditing()" type="button" value="Remove RO" /&gt;

    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
