I have a jquery, it repeats 5 times for 5 buttons. I'm not good in Jquery, so I want to ask how can I optimize my code in 1 function ? Thanks
$(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 }
});
});
..........