![]() |
VOOZH | about |
In this article, we will see how to set the radio button checked by button click in AngularJS, along with knowing its implementation through the examples.
Approach: The approach is to use the ng-checked directive to check the radio button in the DOM. In the first example, a single radio button is checked by the button and In the second example, multiple radio buttons are checked by the button. The ng-model directive is used to bind the radio buttons.
Example 1: This example illustrates setting the single radio button checked by button click in AngularJS.
Output:
Example 2: This example illustrates setting the multiple radio button checked simultaneously by button click in AngularJS.
Output: