• February 23, 2023

    possible to transform this code to formula :

    
    <label for="ageSelect">Age:</label>
    <select id="ageSelect" onchange="updateValueY()">
      <option value="0" selected>0</option>
      <option value="1">1</option> 
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>  
      <option value="6">6</option>
      <option value="7">7</option>
      <option value="8">8</option>
      <option value="9">9</option>
      <option value="10">10</option>  
      <option value="11">11</option> 
      <option value="12">12</option>
      <option value="13">13</option>
      <option value="14">14</option>
      <option value="15">15</option>  
      <option value="16">16</option>
      <option value="17">17</option>
      <option value="18">18</option>
      <option value="19">19</option>
      <option value="20">20</option>
      <option value="21">21</option> 
      <option value="22">22</option>
      <option value="23">23</option>
      <option value="24">24</option>
      <option value="25">25</option>  
      <option value="26">26</option>
      <option value="27">27</option>
      <option value="28">28</option>
      <option value="29">29</option>
      <option value="30">30</option>
      <option value="31">31</option> 
      <option value="32">32</option>
      <option value="33">33</option>
      <option value="34">34</option>
      <option value="35">35</option>  
      <option value="36">36</option>
      <option value="37">37</option>
      <option value="38">38</option>
      <option value="39">39</option>
      <option value="40">40</option>
      <option value="41">41</option> 
      <option value="42">42</option>
      <option value="43">43</option>
      <option value="44">44</option>
      <option value="45">45</option>
      <option value="46">46</option>
      <option value="47">47</option> 
      <option value="48">48</option>
      <option value="49">49</option>
      <option value="50">50</option>
      <option value="51">51</option> 
      <option value="52">52</option>
      <option value="53">53</option>
      <option value="54">54</option>
      <option value="55">55</option>
      <option value="56">56</option>
      <option value="57">57</option>
      <option value="48">58</option>
      <option value="49">59</option>
      <option value="50">60</option>
      <option value="61">61</option> 
      <option value="62">62</option>
      <option value="63">63</option>
      <option value="64">64</option>
      <option value="65">65</option>
      <option value="66">66</option>
      <option value="67">67</option>
      <option value="68">68</option>
      <option value="69">69</option>
      <option value="70">70</option>  
    </select>
    

    เปลี่ยนเป็น

    <select id="ageSelect" onchange="updateValueY()">
      <?php for ($i = 0; $i <= 70; $i++) { ?>
        <option value="<?php echo $i; ?>" <?php if ($i === 0) { echo 'selected'; } ?>><?php echo $i; ?></option>
      <?php } ?>
    </select>
    

    The formula above uses a for loop to generate the options for the select element, iterating from 0 to 70. Each option has a value and label equal to the current iteration value, and if the current iteration value is 0, the selected attribute is added to the option.



เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories


Uncategorized