Skip to content

.selection('insert', opts)

madapaja edited this page May 9, 2012 · 1 revision

選択文字列の前、もしくは後に文字列を挿入します

example

$('#textarea').selection('insert', {
    text: '選択テキストの前に挿入されます',
    mode: 'before'
});

パラメータ

opts.text {String}

挿入する文字列

opts.mode {String}

挿入モード "before", "after" のいずれか。

  • "before" - 選択開始位置(選択文字列の前)に文字列を挿入する
  • "after" - 選択終了位置(選択文字列の後)に文字列を挿入する

opts.caret {String}

キャレットモード "keep", "start", "end" のいずれか。 指定がない場合、"keep" として処理されます。

  • "keep" - 選択状態を保持させる
  • "start" - 選択開始位置にキャレットを移動させる
  • "end" - 選択終了位置にキャレットを移動させる

Clone this wiki locally