如何在达到最大字符限制后阻止用户输入新字符?
Ckeditor charcount插件只显示剩余的字符,我希望它停在0.但它会减去整数.
这是我的HTML代码.
<textarea id="myTextEditor1" name="myTextEditor"></textarea>
<script type="text/javascript">
CKEDITOR.replace('myTextEditor1', {
height: 200,
extraPlugins: 'charcount',
maxLength: 10,
toolbar: 'TinyBare',
toolbar_TinyBare: [
['Bold','Italic','Underline'],
['Undo','Redo'],['Cut','Copy','Paste'],
['NumberedList','BulletedList','Table'],['CharCount']
]
});
</script>
Run Code Online (Sandbox Code Playgroud)
我必须使用onChange插件吗?如果我必须如何限制用户输入新字符?