I am trying, using jquery, to trigger an event when a child element, in this case select, changes.
Here is my HTML:
<div id="addForm" ng-repeat="forme in formes" class="row addForm">
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-6">
<select id="geo_{{forme.id}}" ng-model="forme.geo" class="form-control">
<option value="rectangle">Rectangle</option>
<option value="triangle">Triangle rectangle</option>
<option value="cercle">cercle</option>
</select>
</div>
</div>
The javaScript that is not working yet:
$(document).ready(function () {
$(document.body).on("change", "#addForm > select", function () {
alert(this.value);
});
});
OR
$(document).ready(function () {
$(document.body).on("change", ".addForm > select", function () {
alert(this.value);
});
});
Both method are not working
What is wrong with this?