/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script> $("input[type=radio]").click(function() { var total = 0; $("input[type=radio]:checked").each(function() { total += parseFloat($(this).val()); }); $(".totalSum").val(total); }); </script> <html> <body> <input type="radio" value="15"/> <input type="radio" value="20"/> <input type="radio" value="30"/> <input class="totalSum" type="text"/> </body> </html>
Comments
