Reputation: 9121
How would i disable a textarea without using jQuery?
Am using the following at the moment:
$("#textareaId").attr("disabled", "disabled");
Upvotes: 0
Views: 106
Reputation: 3591
Try below
document.getElementById("mytxt").disabled=true;
Link to fiddle here
Upvotes: 0
Reputation: 9616
Try with setAttribute method and check any difference in output.
document.getElementById("textareaId").setAttribute('disabled', true);
Upvotes: 0
Reputation: 382150
Simply do
document.getElementById("textareaId").disabled=true;
jQuery is a JavaScript library, everything you do using it can be done in JavaScript, even if it's often a little more verbose or implies a greater care to browser differences. See http://vanilla-js.com/
Upvotes: 4