Collapse collapsible via Javascript
Description
The following code shows how to collapse collapsible via Javascript.
Example
<!-- www . j a v a 2 s . c o m-->
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.css">
<script type='text/javascript'>//<![CDATA[
$(function(){
$('#break').click(function() {
$('#set1 h2.section_title').text('Now my style is gone!');
$('#set1').collapsible({refresh: true});
});
});//]]>
</script>
</head>
<body>
<div id="set" data-role="collapsible-set">
<div data-role="collapsible" id="set1" data-collapsed="false">
<h2 class="section_title">Section 1</h2>
<ul data-role="listview">
<li><a href="#"><h3>item 1</h3></a></li>
<li><a href="#"><h3>item 2</h3></a></li>
<li><a href="#"><h3>item 3</h3></a></li>
</ul>
</div>
</div>
<a href="#" id="break">Break it</a>
</body>
</html>