【发布时间】:2018-08-01 02:56:54
【问题描述】:
我想使用一个函数创建一些 jquery 组件并在 html 中使用它们,但不知道该怎么做。这是我尝试过的。
function CreateElement (id, type) {
$(document).ready (function () {
if (type == "metricCombobox") {
var element = $('#' + id).combobox();
return element;
}
});
}
在 HTML 页面中。
<select id="' + CreateElement('metricComboboxSimples', 'metricCombobox') + '" >
【问题讨论】:
标签: javascript jquery html components