Although it is a simple effect, or need to accumulate, record a bit;
After August 1, delete the last item and add a new level 2016
— —Level 2015Level 2014Level 2013Level 2012
After June 1, delete the last item and add a new level 2016
— —Level 2016Level 2015Level 2014Level 2013
Source:
<select id= "Myselect1",
<option value= "" >--</OPTION>
<option value= "Level 2015" >201 Level 5 </option>
<option value= "Level 2014" >2014 level </option>
<option value= "Level 2013" >2013 level </ Option>
<option value= "Level 2012" >2012 </option>
</select><br><br>
<select id= "Myselect2",
<option value= "" >--</OPTION>
<option value= "Level 2015" >2015 level < ;/option>
<option value= "Level 2014" >2014 </option>
<option value= "Level 2013" >2013 level </option
<option value= "level 2012" >2012 level </option>
</select>
var time = new Date ();
var month=time.getmonth () +1;
var day=time.getday ();
if (month>5&&day>1) {
var Objselect=document.getelementbyid ("Myselect2");
ObjSelect.options.add (New Option ("Level 2016", "Level 2016"), 1);
ObjSelect.options.remove (5);
}
if (month>7&&day>1) {
var Objselect=document.getelementbyid ("Myselect1");
ObjSelect.options.add (New Option ("Level 2016", "Level 2016"), 1);
ObjSelect.options.remove (5);
}
JS dynamically add Select option by system time limit