• <small id='19ki9'></small><noframes id='19ki9'>

    1. <i id='19ki9'><tr id='19ki9'><dt id='19ki9'><q id='19ki9'><span id='19ki9'><b id='19ki9'><form id='19ki9'><ins id='19ki9'></ins><ul id='19ki9'></ul><sub id='19ki9'></sub></form><legend id='19ki9'></legend><bdo id='19ki9'><pre id='19ki9'><center id='19ki9'></center></pre></bdo></b><th id='19ki9'></th></span></q></dt></tr></i><div id='19ki9'><tfoot id='19ki9'></tfoot><dl id='19ki9'><fieldset id='19ki9'></fieldset></dl></div>
        <bdo id='19ki9'></bdo><ul id='19ki9'></ul>

    2. <tfoot id='19ki9'></tfoot>

        <legend id='19ki9'><style id='19ki9'><dir id='19ki9'><q id='19ki9'></q></dir></style></legend>
      1. 遍历 div 内的输入

        时间:2024-04-18

                <bdo id='HhIVz'></bdo><ul id='HhIVz'></ul>

              • <i id='HhIVz'><tr id='HhIVz'><dt id='HhIVz'><q id='HhIVz'><span id='HhIVz'><b id='HhIVz'><form id='HhIVz'><ins id='HhIVz'></ins><ul id='HhIVz'></ul><sub id='HhIVz'></sub></form><legend id='HhIVz'></legend><bdo id='HhIVz'><pre id='HhIVz'><center id='HhIVz'></center></pre></bdo></b><th id='HhIVz'></th></span></q></dt></tr></i><div id='HhIVz'><tfoot id='HhIVz'></tfoot><dl id='HhIVz'><fieldset id='HhIVz'></fieldset></dl></div>
                <legend id='HhIVz'><style id='HhIVz'><dir id='HhIVz'><q id='HhIVz'></q></dir></style></legend>
                • <tfoot id='HhIVz'></tfoot>
                • <small id='HhIVz'></small><noframes id='HhIVz'>

                    <tbody id='HhIVz'></tbody>
                  本文介绍了遍历 div 内的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试遍历通过 jQuery 放置在特定 div 上的所有输入,但没有响应.我无法使用警报查看输入的值.我究竟做错了什么 ?

                  I'am trying to iterate through all inputs which are placed on a specific div via jQuery, but there is no response. I can't see the values of inputs by using alert. What am I doing wrong ?

                  <form id="internshipStage2Form" method="POST" action="form2.php">
                      <center>
                          <table id="studentInformation" border="1">
                              <caption style="color:#f00;">Student(Trainee) Information</caption>
                              <tr>
                                  <td valign="middle" align="center">
                                      <label id="stuEmailLabel" for="stuEmailText">E-mail Address</label>
                                  </td>
                                  <td valign="middle" align="center"><?php echo $email; ?></td>
                              </tr>
                              <tr>
                                  <td valign="middle" align="center">
                                      <label id="stuPhoneLabel" for="stuPhoneText">Phone</label>
                                  </td>
                                  <td><input id="stuPhoneText" type="text" name="stuPhoneText"/></td>
                              </tr>
                          </table>
                          <div id="companyInfo">
                              <table id="companyInformation" border="1">
                                  <caption style="color:#f00;">Company Information</caption>
                                  <tr>
                                      <td valign="middle" align="center">
                                          <label id="companyNameLabel" for="companyNameText">Company Name</label>
                                      </td>
                                      <td><input id="companyNameText" type="text" name="companyNameText"/></td>
                                  </tr>
                                  <tr>
                                      <td valign="middle" align="center">
                                          <label id="companyAdressLabel" for="companyAdressText">Address</label>
                                      </td>
                                      <td><input id="companyAdressText" type="text" name="companyAdressText"/></td>
                                  </tr>
                                  <tr>
                                      <td valign="middle" align="center">
                                          <label id="companyPhoneLabel" for="companyPhoneText">Phone</label>
                                      </td>
                                      <td><input id="companyPhoneText" type="text" name="companyPhoneText"/></td>
                                  </tr>
                                  <tr>
                                      <td valign="middle" align="center">
                                          <label id="" for="">Did the any students work as trainees in the company in the previous years?</label>
                                      </td>
                                      <td valign="middle" align="center">
                                          Yes<input id="g1Positive" type="radio" name="g1" value="YES"/>
                                          No<input id="g1Negative" type="radio" name="g1" value="NO"/>
                                      </td>
                                  </tr>
                              </table>
                          </div>
                          <h4 style="color:#f00;">
                              I agree the terms.
                          </h4>
                          <input id="stuDecCheckBox" type="checkbox" name="stuDecCheckBox" /></br>
                          <input id="sendButton" type="submit" name="sendButton2" value="SEND FOR APPROVEMENT"/>
                      </center>
                  </form>
                  

                  JS

                  $('#companyInfo').children('input').each(function () {
                      alert(this.value);
                  });
                  

                  如有任何帮助,将不胜感激.

                  Any help would be appriciated.

                  推荐答案

                  您的输入不是 #companyInfo 的子级.只需这样做:

                  Your inputs are not children of #companyInfo. Just do this:

                  $('#companyInfo input').each(function () {
                      alert(this.value);
                  });
                  

                  这篇关于遍历 div 内的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何遍历Angular 2中的对象属性 下一篇:如何更新为 javascript/jquery 中的 for 循环的每次迭代显示的 html?

                  相关文章

                  1. <small id='cn7Kh'></small><noframes id='cn7Kh'>

                    <i id='cn7Kh'><tr id='cn7Kh'><dt id='cn7Kh'><q id='cn7Kh'><span id='cn7Kh'><b id='cn7Kh'><form id='cn7Kh'><ins id='cn7Kh'></ins><ul id='cn7Kh'></ul><sub id='cn7Kh'></sub></form><legend id='cn7Kh'></legend><bdo id='cn7Kh'><pre id='cn7Kh'><center id='cn7Kh'></center></pre></bdo></b><th id='cn7Kh'></th></span></q></dt></tr></i><div id='cn7Kh'><tfoot id='cn7Kh'></tfoot><dl id='cn7Kh'><fieldset id='cn7Kh'></fieldset></dl></div>
                    <tfoot id='cn7Kh'></tfoot>

                      <bdo id='cn7Kh'></bdo><ul id='cn7Kh'></ul>

                    1. <legend id='cn7Kh'><style id='cn7Kh'><dir id='cn7Kh'><q id='cn7Kh'></q></dir></style></legend>