I have a basic question regarding jQuery.
I have a static time-selection box IE:
<select name="startTime" class="startTime">
<option value="00:00:00">12:00am</option>
<option value="00:15:00">12:15am</option>
<option value="00:30:00">12:30am</option>
<option value="00:45:00">12:45am</option>
etc...
</select>
So when I run my MySQL Query I pull a date from the database, and I want to make a specific time frame selected
my database returns a value such as, “00:30:00” date(H:i:s)
So I need to make “00:30:00” the selected value with jQuery, and i’m not exactly sure how to make that happen.
I thought it was something like this:
$(".startTime").val('<?php echo $timeStart; ?>');
Perhaps someone could shed some light.
First you should use the element tag name in the selector for efficiency
Second you should check what the value of
<?php echo $timeStart; ?>is, because the following should work.