I have two text boxes which hold from date and to date in my page. I have some buttons. When I click on the button 1day, the from date and to date should be set to today's date. When I click on the button 1 week, to date should be set to today's date and from date should be set to 1 week before today. Other buttons have similar functionality. How can I do that using jQuery or JavaScript? Please provide me with a FIDDLE
<div id="date">
From: <input type="text" size="6" name="date" id="from" class="tcal">
To: <input type="text" size="6" name="date1" id="to" class="tcal">
<button id="1day"> 1 Day </button>
<button id="month"> 1 Month</button>
<button id="3month"> 3 Month</button>
<button id="year"> 1 year</button>
</div>