문제

I'm trying to clear my MarkItUp editor. So far I've figured out how to put text in with the $.markItUp function, but I can't figure out how I'm supposed to clear the text box. I've tried just replaceWith: "", but I can't get all the text selected with javascript so that it is replaced by replaceWith. Also, if I try to replace it by setting the text inside of the textarea, the text shows up as blank in the text area, but not in the editor itself. Any help?

Here's what I'm using to insert the text:

        $.markItUp({
            openWith:"[quote="+data['username']+";"+postid+"]",
            closeWith:'[/quote]',
            placeHolder: data['content']
        });

I've tried:

$("textarea.bbcode-quickreply").text('');

This removes the text in the element, but the editor isn't affected.

도움이 되었습니까?

해결책

You haven't given any sample code, so I had to assume things.

<script type="text/javascript">
    $(document).ready(function(e) {
        $("#someID").Click(function(event_parameter) {
            $("#someID").val("");
        });
    });
</script>
<textarea id="someID" name="someName"></textarea>

The above code will empty the textbox as soon as the user clicks on it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top