How to show all div with the same id?

this is my javascript and i want to show all the div with the same id.

    $(document).ready(function() {
   $("input[name$='interest']").click(function() {
    var test = $(this).val();


    $("div.desc").hide();
    $("#Subs" + test).show();




});
         });

this is my html.hope you can help me because im still new in javascript

           <div>
                        Art<input type="radio" name="interest" checked="checked" value="1" />

                        Business<input type="radio" name="interest" value="2" />
                        try<input type="radio" name="interest" value="4" />


                        @foreach($interests as $interest)
                            <div id="Subs{{$interest['interest_id']}}" class="desc">

                            <label><input type="checkbox" id='1' />{{$interest['interest_name']}}</label>

                            </div>
                        @endforeach     
                        </div>


Source: New Questions

Leave a Reply