Trigger button event
Description
The following code shows how to trigger button event.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.4.js'></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css">
<script type='text/javascript'
src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!-- w w w . j ava 2s .c om-->
$('#hiddenDialog').trigger('click');
});//]]>
</script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header">
<h1>Welcome</h1>
</div>
<div data-role="content">
<h2>You are here</h2>
</div>
<div data-role="footer">
<h5>© by Design</h5>
</div>
<a href="#loginDialog" id="hiddenDialog" data-rel="dialog"
data-transition="pop" style="display: none;">Open dialog</a>
</div>
<div data-role="page" id="loginDialog">
<div data-role="header">
<h1>Login</h1>
</div>
<div data-role="content">
<h2>Hello World!</h2>
</div>
<div data-role="footer">
<h5>© by Design</h5>
</div>
</div>
</body>
</html>