In Onselect event I have script:
$(\"#vinanghinguyen_images_bbocde\").val(\'\');
$(\"#vinanghinguyen_images_bbocde\").val(vinanghinguyen_final_bbcode);
I agree with @Jakub Arnold's answer. The problem should be somewhere else. I could not figure out the problem but found a work around.
Wrap your concerned element with a parent element and cause its html to create a new element with the id you are concerned with. See below
<div id="theParent">
<div id="vinanghinguyen_images_bbocde"></div>
</div>
'onSelect' : function(event,ID,fileObj) {
$("#theParent").html("<div id='vinanghinguyen_images_bbocde'></div>");
$("#vinanghinguyen_result").hide();
$(".uploadifyQueue").height(315);
}
When you do $("#vinanghinguyen_images_bbocde").val('');
, it removes all the content of the textarea, so if that's not what is happening, the problem is probably somewhere else.
It might help if you post a little bit larger portion of your code, since the example you provided works.
I just tried using this code and @psynnott's answer was correct though I needed to know it would work repeatedly, seems to work with jquery 1.7.1 >
I modified the jfiddle to the following http://jsfiddle.net/Rjj9v/109/
$('#mytext').text('');
This is not a new answer @psynnott is correct I am just providing a more concise example that shows the textarea is still working after the clear because if you use .val("") the text area stops working
Correct answer is: $("#selElement_Id option:selected").removeAttr("selected");
I believe the problem is simply a spelling error when writing bbcode as bbocde:
$("#vinanghinguyen_images_bbocde").val('')
should be:
$("#vinanghinguyen_images_bbcode").val('')