In my process of creating a unique custom design, I opted not to utilize a select element. Instead, I attempted to retrieve the value in handleSubmit(), but it kept displaying as undefined in the console.
https://i.sstatic.net/xZLuo.png
const handleSubmit = (event) => {
event.preventDefault();
var timing = document.getElementById("timings-id");
console.log(timing.value);
}
<form>
<div class="timings" id="timings-id">
<div value="01:00">01:00</div>
<div value="02:00">02:00</div>
<div value="03:00">03:00</div>
<div value="04:00">04:00</div>
<div value="05:00">05:00</div>
<div value="06:00">06:00</div>
<div value="07:00">07:00</div>
<div value="08:00">08:00</div>
<div value="09:00">09:00</div>
<div value="10:00">10:00</div>
<div value="11:00">11:00</div>
<div value="12:00">12:00</div>
</div>
<button type="submit" onclick="handleSubmit()">BOOK<button>
</form>