I'm not really a javascript/jquery coder, I have a very simple code to remove a div that's not working in IE
I'm using this in a Joomla page, so I call it like this:
$document->addScript("http://code.jquery.com/jquery-latest.js");//adiciona jquery
And than, in the body document:
<script>
setTimeout(function() {
$("#yourDiv").remove();
}, 50000);
</script>
FireFox and Chrome are (as always) ok. Can someone point out my mistake please? Thanks a lot :)
EDITED ************
I've tryied also with this code no jquery, but always not working in IE (9)
<script>
setTimeout('yourFunction();', 5000);
function yourFunction(){
var div = document.getElementById("yourDiv");
div.parentNode.removeChild(div);
}
</script>
<script>
$(document).ready(function(){
setTimeout(function() {
$("#yourDiv").remove();
}, 50000);
});
</script>
Check this fiddle, it's working in ie too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With