如果我按下“添加行”按钮,我必须调用 div id=" addObjectForm " 这是我的示例代码。
<div class="row mt" id="addObjectForm">
<div class="col-sm-1">
<button type="button" id="addRowButton">Add Row</button>
</div>
</div>
提前致谢
在下面的代码中找到 jQuery....
$('#addRowButton').click(function(e){
var id = $(this).closest('.mt').attr('id');
alert('ID : '+id);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row mt" id="addObjectForm">
<div class="col-sm-1">
<button type="button" id="addRowButton">Add Row</button>
</div>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句