<!doctype html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1"
>
<
link
rel
=
"stylesheet"
href
=
"//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.css"
>
<
script
src
=
"//code.jquery.com/jquery-3.2.1.min.js"
>
</
script
>
<
script
src
=
"//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js"
>
</
script
>
<
script
>
$(function () {
$("#btn").on('click', function () {
var options = $("#divID").collapsible("option");
document.getElementById('gfg').innerHTML +=
"No of key/value pair present : " +Object.keys(options).length;
});
});
</
script
>
</
head
>
<
body
>
<
center
>
<
div
data-role
=
"page"
id
=
"page1"
>
<
div
data-role
=
"header"
>
<
h1
style
=
"color:green;"
>GeeksforGeeks</
h1
>
<
h3
>
jQuery Mobile Collapsible option() Method
</
h3
>
</
div
>
<
div
role
=
"main"
class
=
"ui-content"
>
<
div
data-role
=
"collapsible"
id
=
"divID"
>
<
h3
>GeeksforGeeks</
h3
>
<
p
>
GeeksforGeeks is a computer science portal
for geeks. It contains well written, well
thought and well explained computer science
and programming articles, quizzes etc.
</
p
>
</
div
>
</
div
>
<
input
type
=
"button"
id
=
"btn"
style
=
"width: 200px;"
value
=
"Option"
>
<
h4
><
span
id
=
"gfg"
></
span
></
h4
>
</
div
>
</
center
>
</
body
>
</
html
>