Why does this work and not this (wrapInner() inside a function works but not standalone)

Why does this work and not this (wrapInner() inside a function works but not standalone)

// This entire post is related to IE9 only. All other browsers work
// this works
  1. if ($('.bttnnew').length) {
        $('.bttnnew').addClass('hasIcon').each(function(){
            var content = $(this).html();
            $(this).html('<span class=txtDesc>'+content+'</span><span class=iconHolder></span>');
        });
    };




yields:
  1. <a href="..." class="bttnnew hasIcon"><span class="txtDesc">Default Button Text</span><span class="iconHolder"></span></a>

// But this does NOT work
// in IE 9
  1. if ($('.bttnnew').length) {
        $('.bttnnew').addClass('hasIcon').wrapInner('<span class=txtDesc />').append('<span class=iconHolder />');
    };

The second function yields only:
  1. <a href="..." class="bttnnew hasIcon">Default Button Text</a>
Thoughts?