以下
$('input[type = text]').on('keyup', function (e) {
});
在静态创建的控件上非常有用
<input id="txtSearch" type="text" class="col-md-12 col-sm-12 col-xs-12 col-lg-12">
但不会在动态创建并呈现为
<input type="text" class="form-control" id="idName" name="textBox">
通过ajax json响应和html的混合。
jQuery.each(response.controls, function (index, item) {
var input = jQuery("<div class='form-group'><input type='text' class='form-control' id='" + item.id + "' name='textBox'></div>");
jQuery('#fields').append(input);
});
我在这里做错什么了?