below is the current solution that i have developed..
<script>
var elements = document.getElementsByClassName("parent");
var myFunction = function() {
var childNode = document.querySelector('.child');
if(childNode.style.display == "block")
childNode.style.display = "none";
else
childNode.style.display = "block";
};
for (var i = 0; i < elements.length; i++) {
elements[i].addEventListener('click', myFunction, false);
}
</script>
below link has the entire code... jsfiddle currently its displays only one row item of p1 even when i click on any of he options p1, p2, p3 and p4..