Clear text area

后端 未结 11 1540
终归单人心
终归单人心 2020-12-01 06:04

In Onselect event I have script:

$(\"#vinanghinguyen_images_bbocde\").val(\'\');
$(\"#vinanghinguyen_images_bbocde\").val(vinanghinguyen_final_bbcode);
         


        
11条回答
  •  粉色の甜心
    2020-12-01 06:29

    This method removes not only child (and other descendant) elements, but also any text within the set of matched elements. This is because, according to the DOM specification, any string of text within an element is considered a child node of that element.

    $('textarea').empty()
    

提交回复
热议问题