I have set this jsfiddle for you, click on the title and the content will show up:
jsfiddle
Basically, with the onclick event of the title you decide wether to show or hide the content, and you change the title so it changes the +/- symbols. Of course this example only shows you how to implement the logic, but there are no nice looking styles applied to it.
the html:
<div class='collapsibleCont'>
<h3 id='collapsible1' class='collapsibleTitle' onclick="handleCollapsible('collapsible1')">+ title</h3>
<p style="display:none" class='collapsibleContent'>helloooooooooooo</p>
</div>
the handleCollapsible(id) function:
function handleCollapsible(id){
var clickedTitle = document.getElementById(id);
var contentC = clickedTitle.parentNode.childNodes[1];
if(contentC.style.display=='none'){
contentC.style.display = 'block';
var mysplittedtitle = clickedTitle.innerHTML.split(" ");
var newTitle = "- "+mysplittedtitle[1];
clickedTitle.innerHTML =newTitle;
}else{
contentC.style.display = 'none';
var mysplittedtitle = clickedTitle.innerHTML.split(" ");
var newTitle = "+ "+mysplittedtitle[1];
clickedTitle.innerHTML=newTitle;
}
}
Doing this with jquery would be much easier. Doing it with jquery-mobile would be MUCH easier. The bad thing about this code is the need to add the onclick event to every collapsible, including the id, which is avoidable and much simpler with jquery.