Skip to content

jQuery.selection(mode)

madapaja edited this page May 9, 2012 · 1 revision

ウィンドウ内の選択されている文字列を取得します

example

// 選択されている部分のHTMLを取得
var selectedText = $.selection('html');

パラメータ

mode {String}

取得モード "text", "html" のいずれか。 指定がない場合、"text" として処理されます。

  • "text" - テキストを取得します
  • "html" - HTMLを取得します

返り値 {String}

選択されている文字列を返します。

Clone this wiki locally