I have this code below where I press a button to show/hide a div. I want the objects inside the div to slide from left to right to appear with an animation in JavaScript. How do I implement that into my code?
<script>
function myFunction() {
var x = document.getElementById("test");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>