Javascript examples for Date Operation:Year
Get current year and next year
<html> <head></head> <body> <select id="MySelectBox"> <option value="1" id="this_year"></option> <option value="2" id="next_year"></option> </select> <script type="text/javascript"> var d = new Date();//from w ww .j a v a2s . co m var x = document.getElementById("this_year"); x.innerHTML=d.getFullYear(); var y = document.getElementById("next_year"); y.innerHTML=d.getFullYear()+1; </script> </body> </html>