获取在表格中选中Checkbox的TD值

时间:2017-07-20 14:56:40

标签: javascript html

这是代码,我试图获取每个TD的值为id = tel2并选中复选框并将所有值存储在textarea中,用逗号分隔,',' 有什么建议吗?

                echo "<div>";

                if ($result->num_rows > 0) {


                    echo "<table border='1' cellpadding='10'>"; 

                    echo "<tr> <th></th> <th>Nom</th> <th>Prenom</th> <th>Tel</th> <th>Classe</th> <th>Annee</th> </tr>";

                    while($row = $result->fetch_assoc()) {
                        echo "<tr>";

                        echo "<td> <input type=\"checkbox\" id=\"case\"></td>";

                        echo "<td>" . $row['nom'] . "</td>";

                        echo "<td>" . $row['prenom'] . "</td>";

                        echo "<td id=\"tel2\">" . $row['tel'] . "</td>";

                        echo "<td>" . $row['classe'] . "</td>";

                        echo "<td>" . $row['annee'] . "</td>";

                        echo "</tr>";
                    }

                        echo "</table>";
                }

                echo "</div>";

                ?>

0 个答案:

没有答案