Get radio value and set to span
Description
The following code shows how to get radio value and set to span.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.7.1.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!--from ww w.ja v a 2s . com-->
$("input[name=langs]:radio").bind( "change", function(event, ui) {
console.log('Lang: '+$(this).val());
$('#selected_lang').html('Language Selected: '+$(this).val());
});
});//]]>
</script>
</head>
<body>
<div data-role="page">
<fieldset data-role="controlgroup">
<legend>Choose a language:</legend>
<input type="radio" name="langs" id="english-lang" value="english" />
<label for="english-lang">English</label> <input type="radio"
name="langs" id="korean-lang" value="korean" /> <label
for="korean-lang">Korean</label>
</fieldset>
<br />
<p>
<span id="selected_lang"></span>
</p>
</div>
</body>
</html>