robnuclear — 2011-06-08T10:02:37-04:00 — #1
I've looked around without much success, so I was hoping some of you here on Sitepoint could help me out. Any help would be greatly appreciated.
cyberalien — 2011-06-08T10:34:33-04:00 — #2
You can use Date object:
var d = new Date(),
current = d.getFullYear();
Code for simple select box would be this:
var d = newDate(), start = d.getFullYear(), text = '<select>';
for(var i=0; i<10; i++)
text += '<option value="' + (start + i) + '">' + (start + i) + '</option>';
text += '</select>';
// do something with text
robnuclear — 2011-06-08T10:48:53-04:00 — #3
Thanks for such a swift reply, CyberAlien.
Many thanks again for your help.