csckid Posted May 27, 2009 Share Posted May 27, 2009 when i write sth in textarea and click on "comment" button several times, the p tag goes outside the white background. How do I keep the height of div tag increasing as comment button clicked several times??? My writing may seems complicated, but after pasting the code you would definitely understand what i am talking about plz help <html> <head> <title>Home</title> <script type="text/javascript"> function pastecomments(){ text=document.getElementById('walltextarea').value; //document.getElementById('homewalltext').innerHTML=text; var pTag = document.createElement("p"); pTag.innerHTML=text; document.getElementById("homewalltext").appendChild(pTag); } </script> <style type="text/css"> /* CSS Document */ #container{ margin: 20px 20px; margin-top:0px; } #middle{ background-color:#FFFFFF; height:300px; } #middleleft{ float:left; margin-left:15px; margin-top:20px; width:500px; } #write{ height:30px; width:110px; float:right; padding-top:6px; background-color:#f7a838; color:#FFFFFF; } </style> </head> <body bgcolor="#173f16"> <div id="container"> <div id="middle" > <div id="middleleft"> <div id="expansion" > <form><textarea rows='7' cols='60' id='walltextarea'></textarea></form><div id='write' onMouseOver='commentsover(this.id)' onMouseOut='commentsout(this.id)' onClick="pastecomments()">     Comments</div> </div> <!--end of expansion--> <div id="homewalltext" style="background-color:#99FFFF"></div> </div><!--end of middleleft--> <div id="quicklinks"> </div><!--end of quicklinks--> </div><!--end of middle--> </div><!--end of container--> </body> </html> Link to comment https://forums.phpfreaks.com/topic/159904-keeping-inside/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.