Good morning, my problem is that when the word hello disappears, the world comes to occupy the place of hello.
Is the div deleted when using fadeOut?
How to make this not happen?
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Hola Mundo</title>
<style>
#caja{
text-align: center;
font-family: "Comic Sans MS", cursive, sans-serif;
font-size: 40px;
}
#caja2{
text-align: center;
font-family: "Comic Sans MS", cursive, sans-serif;
font-size: 40px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
setTimeout(function(){
$("#caja").hide()
.text("¡Hola")
.fadeIn(2000)
.fadeOut(2000);
},2000);
setTimeout(function(){
$("#caja2").hide()
.fadeIn(2000)
.text("Mundo!")
.fadeOut(2000);
},4000);
})
</script>
</head>
<body>
<div id="caja">
</div>
<div id="caja2">
</div>
</body>
</html>