title: Check if a date has been selected. Bootstrap input type date
body: <p>I have some code where I have a simple <em>Bootstrap datepicker</em> <code>&lt;input type="date"/&gt;</code> I need to check whether a value has been selected using <em>JavaScript</em>. When I echo the current value of the <em>input</em> where the <em>date</em> hasn't been selected, I just get a <em>blank</em> and the condition under if statement always results to true. Can someone assist in how to check this correctly?</p>
  
  <p>\EDIT/UPDATE
  I can successfully get the value of the datepicker when a date has been selected. I use <code>var date=$('#date').val()</code> which works well when a date has been selected. But when a date hasn't been selected, it just returns a blank. I need to check for a situation where a date hasn't been selected and do something ... I have tried <code>if(date="")</code> and <code>if(date=null)</code> none of these are efficient. The function never jumps to the else. The if statement always results to true. Is there something I am doing wrong or is my approach totally out of question?</p>