Comparing only time values
<p>I am trying to compare two time values .Like <strong>from time</strong> and <strong>to time</strong> . I am unable to achieve the requirement that, <strong>to time</strong> should be always greater than <strong>from time</strong>. 
I am using jquery time picker. please help I am a new bee .</p>

<p>Below goes my code</p>

<pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/jquery.ui.timeselect.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/date-en-US.js"&gt;&lt;/script&gt;
&lt;script&gt;
    $(function() {
        $('.tp').timeselect({
            'step': 30,
            'format': 'HH:mm',
            autocompleteSettings: {
                autoFocus: true 
            }
        });
    });
&lt;/script&gt;

&lt;div class="detail_items2" id="fromTimeDiv"&gt;
    &lt;p&gt;&lt;label id="fromTimeDiv_Label" for="fromTime_label" class="blue_text2"&gt;From Time &lt;font style="color:red;"&gt;*&lt;/font&gt;&lt;/label&gt;&lt;/p&gt;
    &lt;input type="text"  class="tp" name="fromTime" id="fromTime" maxlength="75"  value=""   onKeyPress="document.getElementById('fromTime_error').innerHTML='';"/&gt;
&lt;/div&gt;
&lt;div class="detail_items2" id ="toTimeDiv"&gt;
    &lt;p&gt;&lt;label id="toTimeDiv_Label" for="toTime_label" class="blue_text2"&gt;To Time &lt;font style="color:red;"&gt;*&lt;/font&gt;&lt;/label&gt;&lt;/p&gt;
    &lt;input type="text" class="tp"  name="toTime" id="toTime" maxlength="75"  value=""   onKeyPress="document.getElementById('toTime_error').innerHTML='';"/&gt;
&lt;/div&gt;
</code></pre>

<p>For Date I'm comparing as below .Please help me in time i.e. To Time should always be greater than From Time</p>

<pre><code>if(toDate&lt;fromDate){
    alert("To Date should be greater than or equal to From Date");
    $("input#toDate").focus();
    return false;
}
if (fromTime == "") {
    $("label#fromTime_error").show();
    document.getElementById("fromTime_error").innerHTML="This field is Required.";
    $("input#fromTime").focus();
    document.getElementById("imageCheck").checked = false;
    return false;
}
if (toTime == "") {
    $("label#toTime_error").show();
    document.getElementById("toTime_error").innerHTML="This field is Required.";
    $("input#retoTimeco").focus();
    document.getElementById("imageCheck").checked = false;
    return false;
}
</code></pre>