我有一个 jquery,它对 5 个按钮重复 5 次。我不擅长 Jquery,所以我想问一下如何在 1 个函数中优化我的代码?谢谢
$(function() {
$("#frmEdit\\:idBtn1").datetimepicker({
showOn: "both",
buttonImage: "../../jquery/images/calendarIcon.png",
buttonImageOnly: true,
constrainInput: true,
showButtonPanel: true,
dateFormat: 'dd-M-yy ',
addSliderAccess: true,
sliderAccessArgs: { touchonly: false }
});
});
$(function() {
$("#frmEdit\\:idBtn2").datetimepicker({
showOn: "both",
buttonImage: "../../jquery/images/calendarIcon.png",
buttonImageOnly: true,
constrainInput: true,
showButtonPanel: true,
dateFormat: 'dd-M-yy ',
addSliderAccess: true,
sliderAccessArgs: { touchonly: false }
});
});
..........