<select >
                                                            <option value="2007" selected>2007</option>
                                                            <option value="2008">2008</option>
                                                            <option value="2009">2009</option>
                                                            <option value="2010">2010</option>
                                                        </select>                         
                                <script language="javascript">
                                    //对日期选择部分进行赋值
                                    tick  =  new  Date();
                                    hours  =  tick.getHours();
                                    month  =  tick.getMonth() + 1;
                                    day  =  tick.getDate();
                                    year  =  tick.getYear();
                                    document.getElementById("select1").selectedIndex = year-2007;
                                    document.getElementById("select2").selectedIndex = month-1;
                                    document.getElementById("select3").selectedIndex = day-1;
                                    document.getElementById("select4").selectedIndex = hours-1;
                                </script>

相关文章:

  • 2022-01-01
  • 2022-02-02
  • 2021-11-30
  • 2022-01-01
  • 2021-10-15
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2022-01-01
  • 2022-01-27
  • 2022-01-25
  • 2021-11-29
  • 2022-02-08
  • 2022-01-01
相关资源
相似解决方案