html - Hiding or showing sections of code based on multiple dates -


i'm trying webpage automatically eliminate options dates pass. involves different number of payments closer specific date... i.e., total payment due april 1, can select 4/3/2 or 1 payment plan if start january 1st, 3/2 or 1 payment plan if start between jan 2nd , feb 1st. , on until "pay in full" last month.

i've tried divs hide various sections, can hide first section, after second date, hides of them. trying else if statements hides beginning! i've tried setting blocks {{ without luck.

here's code far:

<!doctype html> <html> <head> <meta name="generator" content="html tidy linux (vers 25 march 2009), see www.w3.org">     <title></title>  <script src="http://code.jquery.com/jquery-1.8.2.min.js"    type="text/javascript"> </script> </head> <body> <h1>test links</h1> <hr> <h1>end...</h1> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="gmz4m4nxh7em6">  <input type="hidden" name="on0" value="plan">  <div id='linkone' style="display:none"> <hr> <table> <tr><td><input type="radio" name="os0" value ="option_0" checked="checked"> </td> <td><strong>4 payments</strong></td></tr> <tr><td><!--fill cell--></td><td>number of payments 4</td></tr> <tr><td><!--fill cell--></td><td>start payments @ checkout</td></tr> <tr><td><!--fill cell--></td><td><!--fill cell--></td></tr> <tr><th>due*</th><th>amount</th></tr> <tr><td>at checkout</td><td>$59.66 usd</td></tr> <tr><td>every 1 month (x 3)</td><td>$59.66 usd</td></tr> <tr><td colspan="2">total $238.64 usd</td></tr> </table> </hr> </div>  <div id='linktwo' style="display:none"> <hr> <table><tr><td> <input type="radio" name="os0" value="option_1"></td> <td><strong>3 payments</strong></td></tr> <tr><td><!--fill cell></td><td>number of payments 3</td></tr> <tr><td><!--fill cell--></td><td>start payments @ checkout</td></tr> <tr><td><!--fill cell--></td><td> <table> <tr><th>due*</th><th>amount</th></tr> <tr><td>at checkout</td><td>$79.44 usd</td></tr> <tr><td>every 1 month (x 2)</td><td>$79.44 usd</td></tr> <tr><td colspan="2">total $238.32 usd</td></tr> </table></td> </hr> </div>  <div id='linkthree' style="display:none"> <hr> <table><tr><td> <input type="radio" name="os0" value="option_2"></td> <td><strong>2 payments</strong></td></tr> <tr><td><!--fill cell--></td><td>number of payments 2</td></tr> <tr><td></td><!--fill cell--><td>start payments @ checkout</td></tr> <tr><td></td><td> <table> <tr><th>due*</th><th>amount</th></tr> <tr><td>at checkout</td><td>$119.01 usd</td></tr> <tr><td>every 1 month (x 1)</td><td>$119.01 usd</td></tr> <tr><td colspan="2">total $238.02 usd</td></tr> </table></td> </hr> </div>  <div id='defaultlink' style="display:none"> <hr> <table><tr><td> <input type="radio" name="os0" value="option_3"></td> <td><strong>1 payment</strong></td></tr> <tr><td><!--fill cell--></td><td>number of payments 1</td></tr> <tr><td><!--fill cell--></td><td>start payments @ checkout</td></tr> <tr><td><!--fill cell--></td><td> <table> <tr><th>due*</th><th>amount</th></tr> <tr><td>at checkout</td><td>$237.70 usd</td></tr> <tr><td>total $237.70 usd</td><td></td></tr> </table></td> </hr> </div>  </td></tr> <tr><td colspan="2"><em>* calculate payments date of checkout. </em></td></tr> </table> <table> <tr><td><em>sign for</em></td></tr> <tr><td><input type="image" src="https://www.paypalobjects.com/en_us/i/btn /btn_installment_plan_lg.gif"   name="submit" alt="paypal - safer, easier way pay online!"></td></tr> </table> <img alt="" border="0" src="https://www.paypalobjects.com/en_us/i/scr /pixel.gif" width="1" height="1"></form> <script type="text/javascript">  window.setinterval(function(){      var countoflinksthatarevalid = 0;      $('#countoflinksthatarevalid').show();      var current = new date();     var linkoneexpirationdate = new date("april 27, 2015 16:17:00")     var linktwoexpirationdate = new date("april 27, 2015 16:18:00")     var linkthreeexpirationdate = new date("april 27, 2015 16:18:30")      if (current.gettime() <= linkoneexpirationdate.gettime()) {         $('#linkone').show();         countoflinksthatarevalid = countoflinksthatarevalid + 1;        } else {      $('#linkone').hide();        }      if (current.gettime() <= linktwoexpirationdate.gettime()) {         $('#linktwo').show();         countoflinksthatarevalid = countoflinksthatarevalid + 1;        } else {      $('#linktwo').hide();        }       if (current.gettime() <= linkthreeexpirationdate.gettime()) {         $('#linkthree').show();         countoflinksthatarevalid = countoflinksthatarevalid + 1;        }     else {      $('#linkthree').hide();        }       if (countoflinksthatarevalid === 0) {         $('#defaultlink').show();        }     else {      $('#defaultlink').hide();       }      $('#time').show();     $('#time').text(current); });   </script> </body> </html> 

the code between div's paypay coding needs stay same.

any ideas?

linktwo html not close properly.missed , tags @ last. linkthree sub item of linktwo