Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

concatenation of loop data in variable using jquery

Below you can check the example of concate data in variable through for loop in jquery
Please refer '+=' in the code for concatenation example

var timedropdowndata = "<select name='select_time'><option>Select time</option>";
for(var hours=0; hours<24; hours++){
  for(var mins=0; mins<60; mins+=30){
    let timestamp = hours+":"+mins;
    timedropdowndata += "<option>"+timestamp+"</option>";

  } // the interval for mins is '30'
} // the interval for hours is '1'
timedropdowndata += "</select>";

I hope it will help you
thank you.
Comment

PREVIOUS NEXT
Code Example
Javascript :: express middleware status code always 200 
Javascript :: setjavascriptenabled why it is used 
Javascript :: what the cjs.js fiel use 
Javascript :: jquery check if click to this self not this child 
Javascript :: giphy javascript github 
Javascript :: django send and receive image data to react 
Javascript :: ubicar escrol en el final 
Javascript :: display rond logo in angular 
Javascript :: crud application in mean stack 
Javascript :: datetimepicker 
Javascript :: get JSON information into html control with javascript 
Javascript :: moment_timezone_1.default(...).tz(...).format is not a function 
Javascript :: keyboard avoidance view not working on react native 
Javascript :: subdomain react app 
Javascript :: When an aqueous solution of AgNO3 is mixed with an aqueous solution of (NH4)2CrO4, a precipitation reaction occurs. For this reaction, a) Write the molecular equation. 
Javascript :: use global variable in anonymous function 
Javascript :: crypto 32 characers encryption node js 
Javascript :: js 10.2 * 100 result of 10.199999 
Javascript :: how to enter js in html 
Javascript :: chandrachaan 
Javascript :: how er create json data file to train our rasa model 
Javascript :: jest check array of objects 
Javascript :: javascipt toggle two buttons 
Javascript :: let scores = [80, 90, 70]; for (const score of scores) { console.log(score); } 
Javascript :: how to draw square to the center in canvas 
Javascript :: how to set Json node in java 
Javascript :: javascript troubleshooting with jest 
Javascript :: lookupedit devexpress get specific row 
Javascript :: how to write a program that determines the minutes since midnight, Jan 1, 1970 in javascript 
Javascript :: angular stepper change wait before changing 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =