Simple question, simple answer!
I often wondered how and if this could be done, and seems to me like its extremely simple:
Assuming you have:
<div id=”darea”>div contents here…</div>
<textarea id=”tarea”>textarea contents…</textarea>
All you have to do in JQuery to clear the contents is:
$(‘#tarea’).val(”);
$(‘#darea’).text(”);
And this should clear the corresponding div and textarea.
Hope this helps someone out there!

Powerball Record: 13,014 RPM
April 14, 2009 at 12:21 am
This simple javascript seems to work as well:
// <p id="test">some text</p> document.getElementById("test").text = "";Haven’t really bothered to test it in all browsers, hope this helps for when you don’t want to include include on the page.
June 17, 2010 at 12:45 pm
You are an idiot! TAKE YOUR WORTHLESS BULLSHIT THAT DOESNT WORK OFFLINE!!! IM SICK AND GODAMN TIRED OF ALL THESE WORTHLESS PAGES WRITTEN BY IDIOTS ALL OVER THE NET WASTING MY FUCKING TIME FUCK YOU
FUCK YOU
FUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOUFUCK YOU
June 17, 2010 at 1:57 pm
jQuery has added new functionality.
Try $('#id').empty();Nick
April 14, 2009 at 12:26 am
Indeed, thanks for that
That is a non-jquery way of clearing the text, which should be helpful to all who don’t use JQuery.
August 8, 2009 at 1:42 am
Not sure when this was added, but JQuery now supports the call empty();
So, you could use something like:
Nick
October 29, 2009 at 3:53 pm
October 29, 2009 at 3:54 pm
hi
October 29, 2009 at 3:55 pm
window.location=”http://google.com”;
hi