Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript dropdown options auto-updating

<select name="year">
<option value="">-- Select Year --</option>
<script type="text/javascript"><!--
var HowManyListItems = 5; // Specify number of "year" selections.
var year = new Date().getFullYear();
for(var i = 0; i < HowManyListItems; i++)
{
   var t = i + year;
   document.write('<option value="' + t + '">' + t + '</option>');
}
//--></script>
</select>
Comment

PREVIOUS NEXT
Code Example
Javascript ::  
Javascript :: Learning Arrow function Syntax 
Javascript :: filter array and get index of num 
Javascript ::  
Javascript ::  
Javascript ::  
Javascript :: react regions 
Javascript :: for (var i = 0; i < 3; i++) { setTimeout(function() { console.log(i); }, 1000 + i); } 
Javascript :: jquery input valueadd 
:: how to prevent todos from vanishing after refreshing page - javascript 
Javascript :: enquire js - simple media query library for Javascript 
:: does script defer keep order 
:: javascript covert html characters to text 
Javascript :: React Readonly rating 
Javascript ::  
Javascript :: `ForwardRef(ListboxComponent)`, expected a ReactNode. at ListboxComponent 
Javascript :: how to bind two ng-content in a component angular 
Javascript :: jquery validate required false with additional function 
::  
Javascript ::  
Javascript :: khai bao bien trong javascript 
Javascript ::  
:: everything be true freecodecamp 
:: node.js how to install a custom version of packgage 
:: omise library 
Javascript ::  
:: how to use props data inside setup 
::  
:: float vape pen instructions 
:: sharepoint javascript get last added item 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =