I have the following code which produces a collapsible list:
<html>
<head>
<style>
.collapsibleList li > input + * {
display: none;
}
.collapsibleList li > input:checked + * {
display: block;
}
.collapsibleList li > input {
display: none;
}
.collapsibleList label {
cursor: pointer;
}
</style>
</head>
<body>
<ul class="collapsibleList">
<li>
<label for="mylist-node9">
<b>TypeOne</b>
</label>
<input type="checkbox" id="mylist-node9" />
<ul style="list-style-type:disc">
<li>
tst
</li>
</ul>
</li>
</ul>
</body>
</html>
I would like to start the page with this list expanded. But I can’t figure out how..
2
Answers
simply add a add a
checked
attributeJust add checked attribute in your input as below