日期:2014-05-16  浏览次数:20893 次

怎样使用js来验证年龄是否大于18岁
<div class="renzhenglx_div">
                            <div class="renzheng_left_div" style="line-height: 20px">
                                生日:</div>
                            <div class="renzheng_right_div">
                                <select name="Date_Year" id="Date_Year" class="select_b_div" style="width: auto;">
                                </select>&nbsp;年&nbsp;&nbsp;
                                <select name="birthday_m" id="birthday_m" class="select_b_div" style="width: auto;">
                                </select>&nbsp;月&nbsp;&nbsp;
                                <select name="birthday_d"" id="birthday_d" class="select_b_div" style="width: auto;">
                                </select>&nbsp;日
                            </div>
                        </div>
------解决方案--------------------
<div class="renzhenglx_div">
  <div class="renzheng_left_div" style="line-height: 20px">
  生日:</div>
  <div class="renzheng_right_div">
  <select name="Date_Year" id="Date_Year" class="select_b_div" style="width: auto;">
  <script type="text/javascript">
      var i;
      for (var i = 1980; i <= 2000; i++) document.write('<option value="' + i + '">' + i + '</option>');
  </script>
  </select>&nbsp;年&nbsp;&nbsp;
  <select name="birthday_m" id="birthday_m" class="select_b_div" style="width: auto;">
  <script type="text/javascript">
      for (var i = 1; i <= 12; i++) document.write(