jQuery Generate Years Dropdown Dynamically using JavaScript

Here i’ll justify a way to use jQuery to come up with years dropdown dynamically in JavaScript or JavaScript generate years dropdown dynamically.

<html xmlns=”http://www.w3.org/1999/xhtml”>
<title>Generate years for dropdown using jQuery</title>
<script type=”text/javascript” src=”http://code.jquery.com/jquery-1.8.2.js”></script>
<script type=”text/javascript”>
var noofyears = 100; // Change whatever you want to
var thisYear = (new
for (var i = 0; i <=
noofyears; i++) {
var year = thisYear – i;
{ value: year, text: year }).appendTo(“#ddlyear”);
<form id=”form1″>
<select id=”ddlyear”></select>


Share Your Comments
Previous iWatch it could be huge
Next Microsoft wants to love his Pro Surface 3 users MacBook Air

About author

Aamir Shaikh
Aamir Shaikh 1705 posts

<p>A Blogger, SEO Analyst and passionate Web Developer from India.<br /> Believes in hard work and continues working to achieve success.</p>

View all posts by this author →

You might also like