我正在使用amsul pickatime picker并通过formatLabel函数生成用于时间标签的自定义html,但是click事件不适用于自定义添加的html,这是我的时间选择器的输出, https://i.stack.imgur.com/3lQmx.png我想绑定点击事件以确认按钮 我怎样才能做到这一点?这是代码
$elem.pickatime(
{
[format: 'HH:i',
disable: \[
true,
\],
closeOnSubmit: false,
interval: 15,
clear: '',
formatSubmit: 'HH:i',
closeOnSelect: false,][1]
formatLabel: function (time) {
var minutes = "";
(time.mins == 0) ? minutes = "00" : minutes = time.mins;
var html = "<d!iv cl!ass='t!ime d-block'>" + time.hour + ":" + minutes + " </d!iv><d!iv cl!ass='conf!irm !h!idden d-block'>Conf!irm</d!iv>";
return html;
},
});