diff --git a/quote.admin.inc b/quote.admin.inc
index 5eb52b2..b71483f 100644
--- a/quote.admin.inc
+++ b/quote.admin.inc
@@ -55,6 +55,13 @@ function quote_settings_form() {
     '#default_value' => _quote_variable_get('nest')
   );
 
+  $form['quote']['highlighted_text'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Quote highlighted text'),
+    '#description' => t('If enabled, javascript will be used for quoting selected (highlighted) text to provide a better user experience.'),
+    '#default_value' => _quote_variable_get('highlighted_text'),
+  );
+
   return system_settings_form($form);
 }
 
diff --git a/quote.js b/quote.js
index 8c8c50c..60a5f09 100644
--- a/quote.js
+++ b/quote.js
@@ -18,4 +18,77 @@ Drupal.behaviors.quote = {
   }
 };
 
+Drupal.behaviors.quoteHighlighted = {
+  attach: function(context, settings) {
+    $('a.quote-link:not(.quote-processed)', context)
+    .addClass('quote-processed')
+    .click(function(e) {
+      var quoteSettings = settings.quote[this.id];
+      var textarea = quoteSettings.textarea;
+      // Don't use this behavior if there isn't an edit-body id.
+      if (!textarea || $(textarea).length == 0) {
+        return true;
+      }
+      e.preventDefault();
+      var selected = getSelectedText();
+      var quoted = (selected.length && selected.length > 0) ? selected : jQuery.trim(quoteSettings.body);
+      var text = '[quote=' + quoteSettings.author + ']' + quoted + '[/quote]\n';
+      insertAtCursor($(textarea).get(0), text);
+    });
+
+    /**
+     * Insert a piece of text at the cursor in a given textarea.
+     *
+     * @param object
+     *   A javascript (not jquery) object.
+     * @param text
+     *   The text to insert.
+     */
+    function insertAtCursor(object, text) {
+      // support for the Wysiwyg module
+      if (Drupal.wysiwyg && Drupal.wysiwyg.instances[object.id] && Drupal.wysiwyg.instances[object.id].insert && Drupal.wysiwyg.instances[object.id].field == object.id) {
+        Drupal.wysiwyg.instances[object.id].insert(text);
+      }
+      // IE support
+      else if (document.selection) {
+        object.focus();
+        var sel = document.selection.createRange();
+        sel.text = text;
+        object.focus();
+      }
+      else if (object.selectionStart || object.selectionStart == '0') {
+        var startPos = object.selectionStart;
+        var endPos = object.selectionEnd;
+        var scrollTop = object.scrollTop;
+        object.value = object.value.substring(0, startPos)+text+object.value.substring(endPos,object.value.length);
+        object.focus();
+        object.selectionStart = startPos + text.length;
+        object.selectionEnd = startPos + text.length;
+        object.scrollTop = scrollTop;
+      }
+      else {
+        object.value += text;
+        object.focus();
+      }
+    };
+
+    /**
+     * Get user highlighted/selected text on page.
+     */
+    function getSelectedText() {
+      if (document.getSelection) {
+        return document.getSelection().toString();
+      }
+      else if (window.getSelection) {
+        return window.getSelection().toString();
+      }
+      else if (document.selection) {
+        return document.selection.createRange().text;
+      }
+
+      return '';
+    }
+  }
+};
+
 }(jQuery));
diff --git a/quote.module b/quote.module
index 9e0114c..eb8cd68 100644
--- a/quote.module
+++ b/quote.module
@@ -70,10 +70,15 @@ function quote_init() {
  */
 function quote_node_view($node, $view_mode) {
   if (user_access('post comments') && in_array($node->type, _quote_variable_get('node_types')) && $node->comment == COMMENT_NODE_OPEN && _quote_variable_get('node_link_display')) {
+    $id = 'quote-link-node-' . $node->nid;
     $links['quote'] = array(
       'title' => t('Quote'),
       'href' => "comment/reply/$node->nid",
-      'attributes' => array('title' => t('Quote this post in your reply.')),
+      'attributes' => array(
+        'title' => t('Quote this post in your reply.'),
+        'class' => array('quote-link'),
+        'id' => $id,
+      ),
       'query' => array('quote' => 1),
       'fragment' => 'comment-form'
     );
@@ -82,6 +87,13 @@ function quote_node_view($node, $view_mode) {
       '#links' => $links,
       '#attributes' => array('class' => array('links', 'inline'))
     );
+
+    if (_quote_variable_get('highlighted_text')) {
+      $settings['quote'][$id]['author'] = $node->name;
+      $settings['quote'][$id]['body'] = $node->body[LANGUAGE_NONE][0]['value'];
+      $settings['quote'][$id]['textarea'] = "#edit-comment-body-{$node->language}-0-value";
+      drupal_add_js($settings, 'setting');
+    }
   }
 }
 
@@ -92,10 +104,15 @@ function quote_comment_view($comment) {
   if (user_access('post comments')) {
     $node = node_load($comment->nid);
     if (in_array($node->type, _quote_variable_get('node_types')) && $node->comment == COMMENT_NODE_OPEN) {
+      $id = 'quote-link-comment-' . $comment->cid;
       $links['quote'] = array(
         'title' => t('quote'),
         'href' => "comment/reply/$node->nid/$comment->cid",
-        'attributes' => array('title' => t('Quote this post in your reply.')),
+        'attributes' => array(
+          'title' => t('Quote this post in your reply.'),
+          'class' => array('quote-link'),
+          'id' => $id,
+        ),
         'query' => array('quote' => 1),
         'fragment' => 'comment-form'
       );
@@ -103,6 +120,13 @@ function quote_comment_view($comment) {
         '#links' => $links,
         '#attributes' => array('class' => array('links', 'inline'))
       );
+
+      if (_quote_variable_get('highlighted_text')) {
+        $settings['quote'][$id]['author'] = $comment->name;
+        $settings['quote'][$id]['body'] = $comment->comment_body[LANGUAGE_NONE][0]['value'];
+        $settings['quote'][$id]['textarea'] = "#edit-comment-body-{$node->language}-0-value";
+        drupal_add_js($settings, 'setting');
+      }
     }
   }
 }
@@ -235,7 +259,8 @@ function _quote_variable_get($name = NULL) {
       'node_types' => array('blog', 'story'),
       'node_link_display' => 1,
       'format' => 0,
-      'nest' => 2
+      'nest' => 2,
+      'highlighted_text' => 1,
     );
     $variables = variable_get('quote', array());
     $variables = array_merge($defaults, $variables);
@@ -357,7 +382,7 @@ function theme_quote($vars) {
   $zebra = $nest & 1 ? 'odd' : 'even';
   $quote_output = '<blockquote class="quote-msg quote-nest-' . $nest . ' ' . $zebra . '">';
   if ($quote_author != '') {
-    $quote_author = t('%author wrote:', array('%author' => $quote_author));
+    $quote_author = t('%author wrote: ', array('%author' => $quote_author));
   }
   else {
     $quote_author = t('Quote:');
