标签:
先上效果图:
默认“今日”是选中状态,是行内样式:
<button type="button" id="today" class="btn-link" onclick="todayDate()" style="color: #0062CC;">今日</button>
上面的日期都是点击才会切换颜色:
//昨日click
function yesterdayDate() {
document.getElementById(‘title‘).value = getYesterdayDate(new Date());
fetYesterdayData();
today.css(‘color‘,‘#555555‘);
}
//今日click
function todayDate() {
document.getElementById(‘title‘).value = formatterDateStr(new Date());
fetTodayData();
today.css(‘color‘,‘#0062cc‘);
}
OK,完成
标签:
原文地址:http://www.cnblogs.com/baiyygynui/p/5142827.html