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.
Also in JavaScript:
- encrypt and decrypt in nodejs
- how to write a range of numbers in if condition js
- javascript string lentrh
- javascript add div to body with class
- public class NameOf { public static String nameof<T>(Expression<Func<T>> name) { MemberExpression expressionBody = (MemberExpression)name.Body; return expressionBody.Member.Name; } }
- discord.js lockdown command
- ignore node_modules
- jquery remove css
- javascript this
- javascript Error: Invalid web service call, missing value for parameter: 'documentId'.
- how to dynamically show image from local storage in react native
- javascript hex to string
- jquery $(document.on click
- javascript howto get xhr
- mongodb unwind
- cut string from string javascript
- how to make div visible and invisible in javascript
- jquery set hidden field value
- react make an ascending descending button
- react router not working with aws amplify
- ajax call do something while
- javascript replace all spaces
- are you sure you want to proceed click ok button javascript code
- jquery .click function call