jquery在循环内滑下函数

i have a jquery function which takes place inside a php loop but i am unable to make it work

Jquery.js

$(document).ready(function(){
    $("#comment_button").click(function(){
        $("#comment_type_area").slideToggle("fast");
    });
});

index.php

....

    echo"<div id='comment_button'>
                Comment
            </div>
            <div id='comment_type_area'>
                <textarea class='commnt' post_id='<?php $shared_id2; ?>' id='text_comment' placeholder='Write a Comment'></textarea><br>
                <button id='post_button' type='button'>Post</button> 
            </div>";    

Output

enter image description here

As you can see i am unable to slide down the rest of the comment div Please Help

You are using ids, ids have to be unique per document.

Try to use classes like:

$(".comment_button").click(function(){
   $(this).next().slideToggle("fast");
});