當前位置:編程學習大全網 - 網站源碼 - 怎樣清空easyui-datebox

怎樣清空easyui-datebox

在不改源碼的前提下給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>

希望對妳有幫助

  • 上一篇:請幫忙啊!通達信附圖公式,改編個出魚雷攻擊紅線時選股預警! 多謝高手幫忙啊!
  • 下一篇:PHP7.2 安裝openssl擴展報錯問題。(centos7.7)?
  • copyright 2024編程學習大全網