1.8.3 wrap in spans

HTML

<h2>1.8.3</h2>
<div class="result"/>

JavaScript

function wrapCharsInSpan (text) {

  var $node = $('<div/>').html(text);
  var $this, html;
  
  $node.children().addBack().contents().each( function (index, element) {

    // only the text!
    if (element.nodeType == 3) {
      
      $this = $(element);
      var text = $this.text().replace(/(.)/g, "<span>$&</span>");
      $this.replaceWith(String(text));
    }
  });
  
  html = $node.html();
  $node.remove();
  $node = null;
  
  return html;
}

var pre = $('<pre/>').text(wrapCharsInSpan('<strong>String</strong>'));
$('.result').append(pre);