I'm facing an issue with CSS and JavaScript that I need help with.
On my webpage, I have several DIVs with unique IDs fetched from a MySQL database. The goal is to make a specific DIV disappear when a user clicks on it. Since everything is dynamic, I've passed the ID as a variable to the function. However, I'm struggling to understand how to correctly use this ID in order to achieve the desired outcome. I am looking for an alternative to document.getElementById()
.
JS:
function flashout(the_unique_id){
document.getElementByID(???).style.display = "";
}
HTML/CSS:
<div id="394" onclick="flashout(394)">...</div>
<div id="723" onclick="flashout(723)">...</div>