XHTML
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>example</title>
</head>
<style >
body{
background: black;
}
div{
background : red;
height: 200px;
margin : 20px 100px;
width : auto;
display: none;
}
button{
color: red;
font-weight:bold;
background : grey;
padding : 5px 20px;
font-size : 1rem;
}
</style>
<body>
<div id="myDIV">
</div>
<button type="button" onclick=myFunction() name="button">CLICK HERE</button>
</body>
<script>
function myFunction(){
document.getElementById("myDIV").style.display = "block";
}
</script>
</html>
QUERY
Upon clicking the button, the div appears abruptly. I am seeking a way to make it appear smoothly.
I attempted this solution but unfortunately, it did not work for me: link.