How to Safely Set the Value of a Textarea in JavaScript

How to Safely Set the Value of a Textarea in JavaScript

Pure JavaScript (does not work in IE on Windows Mobile)
[javascript]
document.getElementById(‘myTextarea’).value = ”;
[/javascript]

Using JQuery:
[javascript]
$(‘#myTextarea’).val(”);
[/javascript]

(Source)[https://stackoverflow.com/a/1642452]

Leave a Reply

Your email address will not be published. Required fields are marked *