Skip to content

.selection('replace', opts)

madapaja edited this page May 9, 2012 · 1 revision

選択文字列を置き換えます

example

$('#textarea').selection('replace', {
    text: '置き換え後のテキスト',
    caret: 'before'
});

パラメータ

opts.text {String}

置き換え後の文字列

opts.caret {String}

"keep", "start", "end" のいずれか。 指定がない場合、"keep" として処理されます。

  • "keep" - 選択状態を保持させる(置き換え後の文字列が選択される)
  • "start" - 選択開始位置にキャレットを移動させる
  • "end" - 選択終了位置にキャレットを移動させる

Clone this wiki locally