Good day. There is a div whose height is 100% with ID container. BODY and HTML height is also 100%. But when adding elements via jQuery using the .append () method, they simply crawl out of the frame of the container. The container does not increase in height.

<body> <div id="container" align="center"> <span> <input type=text id=opt_0 class=additional> </span> </div> </body> </html> JQuery $(document).ready(function(){ ifIssetAddForm();}) ifIssetAddForm(){ if($('.additional').length>0){ $('.additional').keyup(function(event){ if($(this).val()!=''){ var edID=(this.id.replace(/\D/g,''))*1; if($('#opt_'+(edID+1)).length<=0){ var main_elem=$('#opt_'+edID).parent(); var new_elem=$(main_elem).clone(); var new_input=$(new_elem).children('input'); edID++; $(new_input).removeAttr('id').attr('id','opt_'+edID); $('#container').append(new_elem); } 
  • body has an indentation - perfect
  • one
    add the code, at least, that already is - HamSter
  • Are the elements you add there flocked? I need a code. - Duck Learns to Take Cover
  • Items not floated. - Glorymirror

1 answer 1

Try setting the min-height for the div and remove the height and generally check where the elements are actually added. Maybe they do not go there

  • It did not help. The height of the diva is not set at all. But I tried and 100% do it. It still does not change. Elements are placed in a container. But the height of the container remains the same as when the page was first loaded - Glorymirror