agis
agis

Reputation: 1841

clear textarea element

I'm curios if it's possible to clear textarea element when a div element is clicked.

I've started with this markup:

jQuery('.hoverbgpfthnailiface').click(function(e){
    var target = e.target;

    while (target.nodeType != 1) target = target.parentNode;
    if(target.tagName != 'TEXTAREA'){
        jQuery('.header-search-form').css({ 'display' : 'none' });
        jQuery('*').show();
    }

});​

My question is how can I clear also the textarea element when that specific div is clicked? Thanks!

Upvotes: 1

Views: 1081

Answers (1)

Tchoupi
Tchoupi

Reputation: 14681

Just set the value to ''

$('#id_of_your_textarea').val('');

Upvotes: 9

Related Questions