0

This simple thing i'm not able to do and me new to angularjs.. I have two radio buttons(suppose named female and male) with same ng-model and 1 reset button.

When i tap reset button i want both radio button to be unchecked.

I tried many things but did not work.

simple example will be good.

thanks

1

1 Answer 1

1

<script src="//unpkg.com/angular/angular.js"></script>
<body ng-app>
    <input type="radio" name="sex" ng-model="sex"
           value="male">male<br>
    <input type="radio" name="sex" ng-model="sex"
           value="female">female<br>
    sex={{sex}}<br>
    <button ng-click="sex=null">Reset</button>
</body>

For more information, see AngularJS input type=radio Directive API Reference.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.