1

I've a textarea and have implemented jHtmlArea Editor jquery plugin. And when click on reset button. I need to set it to empty or blank.

HTML is as below

  <textarea cols="170" id="area4" rows="20"></textarea>

I tried, But it didn't work.

  $('#area4').htmlarea('html', '');

Any other suggestion please.

Mayank Pathak
  • 3,621
  • 5
  • 39
  • 67

2 Answers2

3

yep i just got this to work:

$('#textarea-content').htmlarea('html',' ');

but this doesn't work

$('#textarea-content').htmlarea('html','');

ok these seems to be best

$('#textarea-content').htmlarea('html','\n');

or

$('#textarea-content').htmlarea('html','\b');

they leave no space at the start

on this page http://jquery-spellchecker.badsyntax.co/jhtmlarea.html

dt192
  • 1,003
  • 7
  • 12
  • http://jhtmlarea.codeplex.com/wikipage?title=Modify%20Editor%20Programatically%20using%20JavaScript – dt192 Apr 18 '13 at 11:28
  • yea im getting very frustrated lol i see the issue the textarea does empty but the iframe doesnt update – dt192 Apr 18 '13 at 11:47
  • this should do it $('#txtDefaultHtmlArea').html('').htmlarea(); but it doesn't either – dt192 Apr 18 '13 at 11:48
  • same issue was with me too..i seeked into html and set body to empty in iframe..:P but didn't work.. – Mayank Pathak Apr 18 '13 at 12:01
1

I just made it with the help of this code. just used an extra white space ;) and worked smooth for me

  $('#area4').htmlarea("html", "  ");
Mayank Pathak
  • 3,621
  • 5
  • 39
  • 67