I need your support in choosing logic. My script pulls several rows from the database and displays on the screen. I want to provide a feedback form for each information. These feedback forms should be hidden and visible when you click on the text (for example, the answer to this question) - Pls refers to the image.

I tried using java script and CSS
<script>
function hideElement()
{
document.getElementById("target").style.display="none";
}
function showElement()
{
document.getElementById("target").style.display="block";
}
</script>
// Data-1 fetched from DB goes here
<a href='#target'>Reply to this post</a>
<span id='target' style='display:none'>
// Feedback form for Data 1 here
</span>
// Data-2 fetched from DB goes here
<a href='#target'>Reply to this post</a>
<span id='target' style='display:none'>
// Feedback form for Data 2 here
</span>
But it only works for the first record - Javascript finds the first object named "target" and sets the display property to "none" or "block"
, , java sript. - ? ( , )