Answers for "concatenation of loop data in variable using jquery"

0

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.
Posted by: Guest on February-20-2021

Code answers related to "concatenation of loop data in variable using jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language