jjzjj

InsertAtCaret

全部标签

javascript - 如何使用 JQuery InsertAtCaret 函数

我找到了JQueryInsertAtCaret函数Here但是没有详细说明如何使用它。我已经尝试了很多来了解如何使用它,但找不到任何方法。这是函数。$.fn.insertAtCaret=function(myValue){returnthis.each(function(){varme=this;if(document.selection){//IEme.focus();sel=document.selection.createRange();sel.text=myValue;me.focus();}elseif(me.selectionStart||me.selectionStart