Check if selected dropdown value is empty using jQuery -
here dropdown in question:
<select name="data" class="autotime" id="eventstarttimemin"> <option value=""></option> <option value="00">00</option> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> <option value="50">50</option> </select>
what want check if current value empty:
if ($("eventstarttimemin").val() === "") { // ... }
but not work, though value empty. appreciated.
you forgot #
on id selector:
if ($("#eventstarttimemin").val() === "") { // ... }
Comments
Post a Comment