提琴: http://jsfiddle.net/xpvt214o/276767/
我想获取附加输入的值。但是当我尝试
$(".isyeri-aralik-btn").on("click",function () {
console.log("clicked");
});
它不起作用。我认为新添加的输入和按钮不是HTML DOM元素。
如何从与该按钮相关的按钮获取最小值最大值?
-
$("#isyeri-aralik").on("click",function () {
$(' <div class="form-group row" >\n' +
' <div class="col-md-3">\n' +
' <input type="text" class="form-control isyeri-min" placeholder="min tl" onkeypress="return isNumberKey(event,this)">\n' +
' </div>\n' +
' <div class="col-md-3">\n' +
' <input type="text" class="form-control isyeri-max" placeholder="max tl" onkeypress="return isNumberKey(event,this)">\n' +
' </div>\n' +
' <div class="col-md-3">\n' +
' <input type="text" class="form-control isyeri-indirim-orani" placeholder="indirim oranı" onkeypress="return isNumberKey(event,this)">\n' +
' </div>\n' +
' <div class="col-md-3">\n' +
' <span class="btn btn-block btn-success isyeri-aralik-btn">Save</span>\n' +
' </div>\n' +
'</div>').appendTo($("#isyeri-aralik-container"));
});
$(".isyeri-aralik-btn").on("click",function () {
/*Get
isyeri-min,
isyeri-max,
isyeri-indirim-orani's
value when click save button of new appended div */
});