开发者

clear value of text area [closed]

开发者 https://www.devze.com 2023-02-18 20:50 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
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

精彩评论

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