在不改源碼的前提下給datebox添加清空按鈕
?<input?id="a"?class="easyui-datebox"?style="width:135px"?data-options="buttons:buttons"><input?id="b"?class="easyui-datebox"?style="width:135px"?data-options="buttons:buttons">
<script?type="text/javascript">
var?buttons?=?$.extend([],?$.fn.datebox.defaults.buttons);
buttons.splice(1,?0,?{
text:?'清空',
handler:?function?(target)?{//target對象就是當前的inupt對象,不需要寫死id
$(target).datebox('setValue',?'');
}
});
</script>
希望對妳有幫助