Update label from button click event
Description
The following code shows how to update label from button click event.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.1.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
<style type='text/css'>
#a, #b {<!-- www . jav a 2s.com-->
display: none;
}
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$('div[data-role="navbar"] a').live('click', function () {
$(this).addClass('ui-btn-active');
$('div.content_div').hide();
$('div#' + $(this).attr('data-href')).show();
});
});//]]>
</script>
</head>
<body>
<div data-role="page">
<div data-role="content">
<div data-role="navbar">
<ul>
<li><a href="#" data-href="a">One (A)</a></li>
<li><a href="#" data-href="b">Two (B)</a></li>
</ul>
</div>
<!-- /navbar -->
<div class="content_div">onLoad Content</div>
<div id="a" class="content_div">Some 'A' Content</div>
<div id="b" class="content_div">Some 'B' Content</div>
</div>
</div>
</body>
</html>