fork download
  1. <html>
  2. <head>
  3. <title></title>
  4. </head>
  5. <body>
  6.  
  7. <p>
  8. <form>
  9. :<select name="s1" onchange="javascript:f1();" size="1">
  10. <option value="2000">2000
  11. <option value="2001">2001
  12. <option value="2002">2002
  13. <option value="2003">2003
  14. <option value="2004">2004
  15. <option value="2005">2005
  16. <option value="2006">2006
  17. <option value="2007">2007
  18. <option value="2008">2008
  19. <option value="2009">2009
  20. <option value="2010">2010
  21. <option value="2011">2011
  22. <option value="2012">2012
  23. <option value="2013">2013
  24. </select>
  25.  
  26. :<select name="s2" onchange="javascript:f2()" size="1">
  27. <option value="1">1
  28. <option value="2">2
  29. <option value="3">3
  30. <option value="4">4
  31. <option value="5">5
  32. <option value="6">6
  33. <option value="7">7
  34. <option value="8">8
  35. <option value="9">9
  36. <option value="10">10
  37. <option value="11">11
  38. <option value="12">12
  39. </select>
  40.  
  41. :<select name="s3" onchange="" size="1">
  42. <option value="1">1
  43. <option value="2">2
  44. <option value="3">3
  45. <option value="4">4
  46. <option value="5">5
  47. <option value="6">6
  48. <option value="7">7
  49. <option value="8">8
  50. <option value="9">9
  51. <option value="10">10
  52. <option value="11">11
  53. <option value="12">12
  54. <option value="13">13
  55. <option value="14">14
  56. <option value="15">15
  57. <option value="16">16
  58. <option value="17">17
  59. <option value="18">18
  60. <option value="19">19
  61. <option value="20">20
  62. <option value="21">21
  63. <option value="22">22
  64. <option value="23">23
  65. <option value="24">24
  66. <option value="25">25
  67. <option value="26">26
  68. <option value="27">27
  69. <option value="28">28
  70. <option value="29">29
  71. <option value="30">30
  72. <option value="31">31
  73. </select>
  74.  
  75. </form>
  76.  
  77. <script>
  78. today=new Date();
  79.  
  80. document.forms[0].s1.value=today.getFullYear();
  81. document.forms[0].s2.value=today.getMonth()+1;
  82. document.forms[0].s3.value=today.getDate();
  83.  
  84. function f1()
  85. {
  86. if(document.forms[0].s1.value!=today.getFullYear())
  87. {
  88. num1=parseInt(document.forms[0].s1.value,10);
  89. num2=parseInt(today.getFullYear(),10);
  90. //day=(num1-num2)*365;
  91. day=(document.forms[0].s1.value-today.getFullYear())*365;
  92. alert(Math.abs(day));
  93. }
  94.  
  95. }
  96.  
  97.  
  98. /*function f2()
  99.   {
  100.   if(document.forms[0].s2.value!=today.getMonth()+1)
  101.   {
  102.  
  103.   month=(document.forms[0].s2.value-(today.getMonth()+1));
  104.   for(i=)
  105.   {
  106.   document.forms[0].s2.options[document.forms[0].s2.value-1]
  107.   }
  108.   alert(Math.abs(day));
  109.   }
  110.  
  111.   } */
  112. </script>
  113.  
  114. <script>
  115.  
  116. </script>
  117.  
  118. </body>
  119. </html>
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty