1

I tried a few simple jQuery manipulation on <button> tags but, for some reasons, didn't work on IE7.

<!-- HTML -->
<button class="button">Hello</button>

// jQuery, using v1.4.4
$('button').html('Hello World!');         // Works on Firefox and IE7.
$('button').addClass('another-class');    // Works on Firefox; *not* on IE7.
$('button').wrapInner('<span></span>');   // Works on Firefox; *not* on IE7.

Does anyone have any clues about this?

Josh Unger
  • 6,717
  • 6
  • 33
  • 55
moey
  • 10,587
  • 25
  • 68
  • 112
  • 1
    maybe has something to do with the behaviour described here: http://www.peterbe.com/plog/button-tag-in-IE ? – jao Sep 17 '11 at 17:35

2 Answers2

4

The button tag isn't fully supported on IE6 and IE7. It isn't related to jQuery, but about the tag itself, as described here: What disadvantages are there to the <button> tag?.

Community
  • 1
  • 1
Erick Petrucelli
  • 14,386
  • 8
  • 64
  • 84
2

I don't see a method named .innerWrap() in jQuery. I see one named .wrapInner(). If I switch your code to .wrapInner(), it works for me in this jsFiddle in IE9 and in IE9 in IE8 and IE7 emulation mode. I don't have the actual IE7 available to try here, so perhaps part of the issue is the partial support in IE7 for the button tag.

jfriend00
  • 683,504
  • 96
  • 985
  • 979