I have file where I'm looping through all events I have in a database and then putting them on the page. I have a button a div at the end of each event div when clicked I would like for that specific div to open. Nothing I've tired works it either opens every div or none at all.
Here's my for the icon to click and expand.
echo "<div id='" . $row['Event ID'] . "' class=\"schedcol schedspan_1_of_12 cellalign expand\"><i class=\"fa fa-arrow-down\" aria-hidden=\"true\"></i><br><span>EXPAND<span></div>";
Here's my code for what I want to expand
echo "<div class=\"list\" style=\"display: none;\">";
echo "<p> " . $row['First Place'] . ", " . $row['Second Place'] . ", ". $row['Third Place'] . "</p>";
echo "</div>";
Here's my javascript
echo "<script>";
echo "jQuery(document).ready(function(){
jQuery('#$eventid').on('click', function(event) {
jQuery('.list').toggle('show');
});
});";
echo "</script>";