点击按钮切换样试

$(function() {
$(".listSearch a").click(function() {
$(this).addClass("listOn").siblings().removeClass("listOn")
})
});

.listOn {
    color: #fff;
    background: #54bd86;
}

jsp
<div class="listSearch" id="months">
<label>交易日期:</label>
<input class="Wdate" type="text" name="fromDate" id="fromDate" value="${params.fromDate }" readonly="readonly" onFocus="WdatePicker({isShowClear:false,readOnly:true,maxDate:'#F{$dp.$D(\'todate\',{M:-$(\'#monthVal\').val()})}'})"/>
至<input class="Wdate" type="text" name="todate" id="todate" value="${params.todate }" readonly="readonly" onFocus="WdatePicker({isShowClear:false,readOnly:true,minDate:'#F{$dp.$D(\'fromDate\')}',maxDate:'%y-%M-%d'})"/>
<!--
<input type="text" /> - <input type="text" />
-->
<button type="submit" id="tradeRecordSubmit">确定</button>
<input type="hidden" value="${params.month }" id="monthVal" name="month">
<a href="#" name="month" class="" title="0">今日</a>
<a href="#" name="month" class="" title="1">最近30天</a>
<a href="#" name="month" class="" title="3">最近90天</a>
<a href="#" name="month" class="" title="6">最近180天</a>
</div>

你可能感兴趣的:(点击按钮切换样试)