Currently, I have a scenario where clicking on an image inside a div triggers the display of another div while simultaneously wanting to hide the original div containing the image. So far, utilizing only the abreInfo() function achieves the desired toggle effect, but I also need to conceal the initial container div when the new one appears. How can this be accomplished?
function abreInfo(event, id) {
event.preventDefault();
$("#" + id).toggle("slow");
}
function fechardiv(div) {
document.getElementById(div).style.display = "none";
}