I am trying to get active carousel id when click to button using laravel

Viewed 16

I am trying to get active carousel id when i click to button for next carousel please help me thanks.

Html view

                                    <div class="carousel-item {{$key == 0 ? 'active' : '' }}  d-flex align-items-center">
                                          <img src="{{ Config('wfh.file') . $roomImage}}" height="113px" alt="First slide">
                                          <div class="ms-4">
                                              <h6 class="fw-bold">{{$value->name}}</h6>
                                              <input type="text" class="room_id"  name="room_id" value="{{$value->id}}" >
                                              <span class="badge bg-light-outline p-2 me-1"> <i class="bx bx-user"></i>{{$value->capacity ?? null }}</span>
                                              <span class="badge bg-primary p-2">Starts from PTS {{$value->points ?? null }}</span>
                                          </div>
                                      </div>

jquery

   $(".butonSubmit").click(function(){

        // let crousalActive= $(".carousel-item").hasClass('active');

        if($(".carousel-item").hasClass('active') ){

            let room_id = $(".carousel-item.active .room_id").val();

            console.log(room_id);
        }

   });
0 Answers
Related