JQuery dynamically generated radio buttons then value is passed to continue button?

Something like for ( var I in json ) { var input = $('', { type: 'radio', name: 'group-name', value: jsoni, 'class': 'my_radio' } ); $('body'). Append( input ); } $('#continue'). Click( function() { var selected = null; $('input.

My_radio'). Each( function() { if ( $(this). Attr( 'selected' ) ) selected = $(this).val(); }); // do something with selected.... }) You'll have to surround it with a form element if you need that.

I haven't tested this, by the way.

Something like for ( var I in json ) { var input = $('', { type: 'radio', name: 'group-name', value: jsoni, 'class': 'my_radio' } ); $('body'). Append( input ); } $('#continue'). Click( function() { var selected = null; $('input.

My_radio'). Each( function() { if ( $(this). Attr( 'selected' ) ) selected = $(this).val(); }); // do something with selected.... }); You'll have to surround it with a form element if you need that.

I haven't tested this, by the way.

$("EntitiesRadio") will find nothing because there is no such tag. Use $("#EntitiesRadio") if you want to select by ID or $(". EntitiesRadio") to select by class.

Once the HTML is added to the page you can bind the change event to it. To make the change event bind automatically to new matching elements you can use the live API.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions