Radio Buttons OnChange event

Selection of radio buttons will be displayed by using onChange event. In case of selection of third radio button ( Five ), no display will change as we have not used the onChange event here.

Three Four Five

Your selection is {{class}}
<div ng-app="my_app" ng-controller="my_ctrl">
<input type=radio ng-model="class" value="Three" ng-change="onChange()"> Three 
<input type=radio ng-model="class" value="Four" ng-change="onChange()"> Four
<input type=radio ng-model="class" value="Five"> Five
<br><br>
Your selection is {{class}}
</div>
<div class='alert alert-primary' role='alert' id=d1>After selection details will appear here</div>
<script>
var app = angular.module('my_app', []);
app.controller('my_ctrl', function($scope) {
  
 $scope.onChange = function()
{
 document.getElementById('d1').innerHTML="Your Selection: " + $scope.class;
} 
    
});
</script>


Radio buttons

Angular Home

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer