$("myDiv").hide(); and $("myDiv").show(); does not work in Internet Explorer.
The way I got around this is to get the contents of the html myDiv using .html() .
Then I wrote his newly created DIV. Then I attached the DIV to the body and added the contents of the Content variable to the HiddenField , then I read that content from the newly created div when I wanted to show the DIV.
After I used the .remove() method to get rid of the DIV that temporarily held my html DIVs.
var Content = $('myDiv').html(); $('myDiv').empty(); var hiddenField = $("<input type='hidden' id='myDiv2'>"); $('body').append(hiddenField); HiddenField.val(Content);
and then when I want to SHOW the contents again.
var Content = $('myDiv'); Content.html($('#myDiv2').val()); $('#myDiv2').remove();
This was more reliable than the .hide() and .show() methods.
Cecil Theodore Aug 31 '11 at 12:03 2011-08-31 12:03
source share