Changing The Value Of a Div on Click of a Button From a Set of Radio Button Using jQuery

Changing the value of a div on click of a button from a set of radio button using jquery:
<div>
<ul>
<li><input type=”radio” value=”radio1″ name=”demoChangeFunc” /></li>
<li><input type=”radio” value=”radio2″ name=”demoChangeFunc” /></li>
<li><input type=”radio” value=”radio3″ name=”demoChangeFunc” /></li>
<li><input type=”radio” value=”radio4″ name=”demoChangeFunc” /></li>
</ul>
<div></div>
</div>

$(‘.radio-button-demo input’).each(function() {
if($(this).attr(‘checked’,’checked’)){
$(‘.list-value’).text($(this).attr(‘value’));
}
})

Dwarika Dhish Mishra

My name is Dwarika Dhish Mishra, its just my name and I am trying to bring the worth of my name in to actions and wants to be the solution not the problem. I believe in spreading knowledge and happiness. More over I am fun loving person and like travelling a lot. By nature I am a tester and a solution maker. I believe in the tag line of http://ted.org “Idea worth spreading” . For the same, I have created this blog to bring more and more learning to tester fraternity through day to day learning in professional and personal life. All contents are the part of my learning and so are available for all..So please spread the contents as much as you can at your end so that it could reach to every needful people in testing fraternity. I am pretty happy that more and more people are showing interest to become the part your Abode QA blog and I think this is good sign for us all because more and more content would be before you to read and to cherish. You may write or call me at my Email id: dwarika1987@gmail.com Cell: 9999978609

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.