Getting Value Of Radio Button And Label Text Put Into Two TextField

I'm trying to get value form label (radio) and value of radio button. When I click label or radio button, they value input into their respective textfield

o 1
• 2
o 3
o 4

 value radio    value label
____________   ______________
|    72    |   |     2      |
|__________|   |____________|

I try create on jsfiddle but not working, only value radio button insert into text field.

See FIDDLE

How do I create function?

Answers


The change doesn't occur on the label. You need to use the change of the radio for both.

$('input[name="20"]').on('change', function() {
        $('input[class="20"]').val($(this).val());
        $('input[class="1_20"]').val($(this).parent().text());
        });

Need Your Help

Multilevel Paging Operating System

operating-system paging

I had this problem in an exam today:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.