Sunday, September 2, 2018

javascript - How to display an output depending on the selected radio button after selecting a radio button?



How to display something on

or after selecting a specific radio button, for example is I have a group of radio button




Interest Value
o 3%
o 5%
o 7%

Amount: 1,450.00


The value of the amount will change depending on the selected radio button. What is the correct method to do this on javascript (without jquery)? What is the best DOM event to use on it?



Answer



You can just listen to its click event.



See the code here on jsfiddle shamlessly copied from OnChange event handler for radio button (INPUT type="radio") doesn't work as one value




3%
5%
7%


Amount:



No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...