Hello
How to display year dynamically in dropdownlist using html.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 31, 2015, 2:08 AM EDT
http://jsfiddle.net/s8HaQ/
html code
javascript
var start = 1900;
var end = new Date().getFullYear();
var options = "";
for(var year = start ; year <=end; year++){
options += "";
}
document.getElementById("year").innerHTML = options;
Abhijeet SinghRank #415 · 6K reputationPosted Mar 31, 2015, 2:27 AM EDT
http://www.marcfirth.co.uk/PHP-Dynamically-Generated-Year-Dropdown
Abhay ShankerRank #375 · 6.7K reputationPosted Mar 31, 2015, 5:58 AM EDT
http://stackoverflow.com/questions/18417114/add-item-to-dropdown-list-in-html-using-javascript