How to get the required value of all input tags that contain the required attribute

  •                     <label class="name">:</label>
                        <input name="" type="text" class="text_Add" required pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" />
                        <span class="form_hint">11</span>
                    </li>
                    <li>
                        <label class="name">:</label>
                        <input name="" type="text" class="text_Add" required pattern="^[\u4e00-\u9fff\w]{5,16}$" />
                        <span class="focus-input100"></span>
                        <span class="form_hint">5-16</span>
                    </li>
                    <li>
                        <label class="name">:</label>
                        <input name="" id="passwd" type="password" class="text_Add"  required pattern="(\w){6,20}" />
                        <span class="form_hint"> 6-20</span>
                    </li>
                    

    I don"t want to get it one by one, because if there are 10, I have to write 10 lines of code to get, which is not efficient.

  • Mar.10,2021

    . Then you add a unified and unique class to all input with required attribute, get the dom, through the class and then loop through the dom array to get the value.

    MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
    MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3afdb-2c24e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    MySQL Errno : 1021
    Message : Disk full (/tmp/#sql-temptable-64f5-1b3afdb-2c24e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    Need Help?