Disable TextArea on Page Load using JQuery
Hello Group,
Simple question. How can I disable a textarea when a page is loaded(and re-enable it on a button click).
I have tried several things with no luck. What I have tried is at the bottom. Here is my code snippets:
' code to generate the text area
<%
=
Html.TextAreaFor(
Function
(model) model.NewestComment.Comment, 2, 60,
New
With
{.id =
"comment"
})%>
' JQuery Code I have tried to disable it....
<
script
type
="text/javascript">
$(document).ready(function() {
$(
"NewestComment.Comment").attr("disabled", "disabled");
' I also tried....
$(
"comment").attr("disabled", "disabled");
Neither of which worked.
Any ideas?
Thanks for your help.
Lee