The code
var comment = $('<div>')
.addClass('comment') // problem in IE7
.attr('id', 'comment-'+item.id)
.appendTo($('#comments-list');
The problem
When program executes to .adddClass in IE7, got error message
Object doesn't support this action
I got this error from IE debugbar.
Any fixes?
[correction] :
I've done further debugging. And found out that the problem didn't lie on addClass call. It was another part code which doesn't work in IE7. Sorry for wasting you guys' time.
For the record since I wasn't able to delete this question, here is the buggy code(in ie7):
$('<button>')
.attr('type', 'button') // This failed in IE7
probably because it doesn't support a dynamically added 'type' attribute. I guess I have to switch to the <input> element now
$('<input')
.attr('type', 'button')
.attr('value', 'Button Text')
This I just tested in IE7 and works. Tho I still prefer the $('<button>') case, so if anybody have any work arounds, please help me here.
Thanks in advance.