i have issue code.. want value radio button when selected , calculate value of selected radio button. , showing result in input text.
<html> <head> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script> $(document).ready(function () { var szradio = '<input type="radio" name="gender" value="1"> male<br> <input type="radio" name="gender" value="2"> female<br> <input type="radio" name="gender" value="3"> other' $('#div_content').append(szradio) $('body').on('change','input[name="gender"]',function () { $('#txtinput').val($(this).val()) }); }); </script> </head> <body> <input type="text" id="txtinput"/> <br /> <div id="div_content"> </div> </body> </html>
Comments
Post a Comment