根据下面的代码,如何使newField像这样 这样的下拉菜单文本字段,因为现在它仍然是文本字段。然后,该值是来自此剩余api https://jsonplaceholder.typicode.com/todos的“标题”列表。谢谢
var addRuleLink = $("<a>", {"href": "#", "class": "add-rule", "text": "Add Condition"});
var _this = this;
addRuleLink.click(function(e) {
e.preventDefault();
var f = _this.fields[0];
var newField = {name: f.value, operator: f.operators[0], value: null};
div.append(_this.buildRule(newField));
});
div.append(addRuleLink);