Jquery append is not working in ie
I am using jquery to append div onclick event but it is not working in ie at though it is working fine is firefox , chrome and safari here is 开发者_开发问答my code
$('#start-chat').live("click",function(){
$(this).parent('.click').append('<div id="forclick">some data inside it</div>');
});
Thanks
Try using .parents(...)
instead of .parent(...)
by way of the code you have given us I created a fiddle demo of what the the code is expecting the html to look like and how this would work let me know if that helps you out
HTML
<div class="click">
<div id="start-chat">start chat</div>
</div>
and your code
$('#start-chat').live("click",function(){
$(this).parent('.click').append('<div id="forclick">some data inside it</div>');
});
精彩评论