Search
 
SCRIPT & CODE EXAMPLE
 

CPP

options select from array

var j = new Array("option1","option2","option3","option4","option5"),    
var options = '';

for (var i = 0; i < j.length; i++) {
   options += '<option value="' + j[i]+ '">' + j[i] + '</option>';
}
$("#rec_mode").html(options);
Comment

options select from array

var videoSrcArr = new Array("option1","option2","option3","option4","option5"),
    selectEl = document.getElementById('rec_mode');


for(var i = 0; i < videoSrcArr.length; i++){
    selectEl.options.add(new Option(videoSrcArr[i], videoSrcArr[i]));
}                              
Comment

options select from array

var states = new Array();
states['India'] = new Array('Andhra Pradesh','Arunachal Pradesh','Assam','Bihar','Chhattisgarh','Goa','Gujarat','Haryana','Himachal Pradesh','Jammu and Kashmir','Jharkhand','Karnataka','Kerala','Madhya Pradesh','Maharashtra','Manipur','Meghalaya','Mizoram','Nagaland','Odisha','Punjab','Rajasthan','Sikkim','Tamil Nadu','Telangana','Tripura','Uttar Pradesh','Uttarakhand','WestBengal','Andaman and Nicobar Islands','Chandigarh','Dadra and Nagar Haveli','Daman and Diu','Lakshadweep','Puducherry'); 

function setStates() {
	var newOptions=states['India'];
	var newValues=states['India'];
	selectField = document.getElementById("state");
	selectField.options.length = 0;
	for (i=0; i<newOptions.length; i++) 
	{
	selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
	}
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ function pointer 
Cpp :: cin c++ 
Cpp :: c++ else if 
Cpp :: C++ Taking Multiple Inputs 
Cpp :: Program to find GCD or HCF of two numbers c++ 
Cpp :: phi function (n log (log(n))) 
Cpp :: pow c++ 
Cpp :: c++ power of two 
Cpp :: sort an array in c++ 
Cpp :: C++ switch..case Statement 
Cpp :: C++ insert character 
Cpp :: binary to decimal online converter 
Cpp :: pragma HLS bracets 
Cpp :: book allocation problem in c++ 
Cpp :: c++ void poiinter 
Cpp :: c++ calling variable constructor 
Cpp :: why the << operator is friend 
Cpp :: how to find second smallest element in an array using single loop 
Cpp :: 3. The method indexOf, part of the List interface, returns the index of the first occurrence of an object in a List. What does the following code fragment do? 
Cpp :: c++ take n number from the user and store them in array and get the max, min number of them and also find the average/summation of these numbers 
Cpp :: true false operator 
Cpp :: decemal representation 
Cpp :: c++ argument list for class template is missing 
Cpp :: Link List Insertion a node 
Cpp :: how to point to next array using pointer c++ 
Cpp :: ue4 c++ add tag 
Cpp :: delay without blocking 
Cpp :: c++ tuple example 
Cpp :: 400 watt hour per kg 
Cpp :: escribir texto c++ 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =