@i_rustem
Знаю java, swift, javaScript, HTML, CSS.

Как задать доступ к chekbox для js?

Нужно посмотреть какие checkbox выбраны, но никак не могу получить к ним доступ. В html находится:

<div class="content1">
    <div class="content">
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="js/forAccount.js"></script>

    <!-- Service section
    ================================================== -->
    <section id="service" class="parallax-section">
        <div class="container">
            <div class="row">

                <div class="col-md-8 col-sm-10">
                    <div class="section-title">
                        <h1>Личный кабинет</h1>

                        <form action="chat" method="get">
                            <input type="submit" value="Чат поддержки">
                        </form>

                        <form action="logout" method="post">
                            <input type="submit" value="logout">
                        </form>

                        <form method="post" action="account">
                            <input type="hidden" name="deleteAccount" value=1/>
                            <input type="submit" value="Удалить аккаунт"/>
                        </form>


                        <br>
                        <br>
                            <h5> </h5>
                        <br>
                        <br>
                        <br>
                        <p>Ваши рейсы</p>
                    </div>
                </div>

                <table id="flightTable" class="table">
                    <thead>
                    <tr>
                        <th>Номер полета</th>
                        <th>Взлет</th>
                        <th>Приземление</th>
                        <th>Город</th>
                        <th>Авиакомпания</th>
                        <th>Терминал</th>
                        <th>Статус</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody class="flightsTable_res">
                    </tbody>
                </table>


                <br>
                <br>
                <br>
                <br>
                <br>
                <div class="col-md-8 col-sm-10">
                    <div class="section-title">
                        <p>Бронирование отеля</p>
                    </div>
                </div>

                <div class="container">
                    <div class="row">

                        <table class="table" id="hotelTable">
                            <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col">Название</th>
                                <th scope="col">Цена</th>
                                <th scope="col">Дата выезда</th>
                                <th scope="col">Дата заезда</th>
                                <th scope="col">Дополнительные услуги</th>
                                <th scope="col"></th>
                            </tr>
                            </thead>
                            <tbody class="hotelTable_res">
                                    <tr id="23">
                                        <td>23</td>
                                        <td>Стандартный номер</td>
                                        <td>4,500</td>
                                        <td>Nov 9, 2020</td>
                                        <td>Nov 7, 2020</td>
                                        <td id="23">
    <input type="checkbox" id="0" value="1" checked=""> Завтрак(200р.) <br>
  
    <input type="checkbox" id="1" value="2" checked=""> Обед(300р.) <br>


Вот последние и мне нужно посмотреть нажаты или нет, в js использую:
$('#hotelTable').find('.hotelTable_res').find("#23").find('#23').find('#0').checked


И не работает.
  • Вопрос задан
  • 45 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы