Hi I am a beginner I wanted to compare my two variables to each other using javascript if ts is greater than timecomp display alert "Okay" else if less than ts display alert "error"
like example ts is 6:15 and time comp is 6:00 alert okay message will display but if less than will display alert message error
<script>
$(document).ready( function(){
var timecomp = "6:00"
var a = $('select[name="hours"] option:selected').val();
var a1 = $('select[name="mins"] option:selected').val();
var ts = a +":" a1;
if( ts> timecomp)
{
alert("Okay");
}
else if ( ts<timecomp){
alert("Error");
}
});
</script>