$(`.timeslot-time[data-start='${preselectedtime}']`) change it for concatenation in javascript

To concatenate the variable preselectedtime into a jQuery selector in JavaScript, you can use string concatenation operator (+) like this:

index.tsx
var preselectedtime = '12:00 PM';
var selector = '.timeslot-time[data-start="' + preselectedtime + '"]';
$(selector).doSomething(); // replace doSomething with your desired code
178 chars
4 lines

In the above code, the variable preselectedtime is concatenated into the jQuery selector using the string concatenation operator (+) to produce the desired selector.

gistlibby LogSnag