开发者

clear value of text area [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜