Q:

div element not growing

I wrote this menu that elements dynamically adds, but after adding elements the parent the div does not grow.
CSS:
#frstMenu
{
    position:absolute;
    top:1.5%;
    right:1%;
    width:23%;
    height:70%;
    background:rgba(0,0,0,0.6);
    border-radius: 5px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    cursor: pointer;
    outline: none;
    padding-top:1%;
    overflow:hidden;
    z-index:2;
}

.menulist1{
    position:absolute;
    width:100%;
    height:15$;
    top:0%;
    right:0%;
    dispaly:none;
    text-decoration: none;
    color: #333;
    clear:both;
    border-bottom: 1px solid #e6e8ea;
    z-index:2;
}

#menulist
{
    position:absolute;
    top: 100%;
    right: 1%;
    width:23%;
    height:500%;
    background: #fff;
    border-radius: 0 0 5px 5px;
    border: 1px solid rgba(0,0,0,0.2);
    border-top: none;
    border-bottom: none;
    list-style: none;
    z-index:1;
 }

HTML:
> <div id="firstMenuList">
>         <div id="frstMenu">choose</div> 
>         <div id="menulist" class="menuList"></div> 
>         <div id="frstList1" class="menuList"></div> <- The child divs are similar this   </div>

Javascript:
function ccc( prnt , id , cls, r ) {

 var ar=new Array("hi","there","hello","world","adsad","asdsad","dsfsdfs","fdsfsdf","sfdsfsdf","soiqeqjek");

 var parent=document.getElementById(prnt);

 for (var i=0;i<ar.length;i++)
    {
    var node=document.createElement("div");

    node.setAttribute("id",id+""+i);
    node.setAttribute("class",cls);
    node.setAttribute("onclick","select('"+id+""+i+"')");
    node.style.top=(((i)*15)+2)+"%";
    node.style.right=r+"%";

    node.innerHTML=ar[i];
    parent.appendChild(node);
    }
    parent.style.display="none";
}

And how do I call that function:
 ccc("menulist","frstMenu","menulist1","0");

Image:

A:

With position: absolute you must grow your menu inside loop (for) - just add height while you are adding each element. 
Code for adding height without using jQuery should in your case look like this:
parent.style.width = parent.clientHeight + 20;

But its of course example and you must change "20" value to your own (calculated).

