clear value of text area [closed]
I would like to clear the value of a text area.
<textarea style="width:850px;height:500px" id="txtEnterProject" name="txtEnterProject">aaa</textarea>
$("#txtEnterProject").cleditor(); //set fckEditor
$("#txtEnterProject").attr("value",null);
$("#txtEnterProject").val(null);
$("#txtEnterProject").text(null);
$("#txtEnterProject").html(null);
$("#txtEnterProject").attr("value",'');
$("#txtEnterProject").val('');
$("#txtEnterProject").text('');
$("#txtEnterProject").htm开发者_如何学Pythonl('');
$("#txtEnterProject").attr("value",' ');
$("#txtEnterProject").val(' ');
$("#txtEnterProject").text(' ');
$("#txtEnterProject").html(' ');
Any idea why none of this works?
Script:
<script type="text/javascript">
function resetEditor(id)
{
FCKeditorAPI.GetInstance(id).SetData('');
}
</script>
or possibly:
<script type="text/javascript">
function resetEditor(id)
{
FCKeditorAPI.GetInstance(id).SetHTML('');
}
</script>
Usage:
resetEditor(txtEnterProject);
Check here for more info : Clearing an FckEditor and here is another link: Using FCKeditor (it is for .NET but it has some things regarding using Javascript to perform functions)
Hope it helps.
精彩评论