In Association with Amazon.in   Flipkart

Tuesday, November 19, 2013

JavaScript InnerHTML Content For Overflow In DIv Tag

JavaScript InnerHTML Content For Overflow:

Example:

<script>
function add_text()
{
n=document.getElementById('un').value;
p=document.getElementById('list').innerHTML;
document.getElementById('list').innerHTML=n + "<br/>" + p;
document.getElementById('un').value="";
document.getElementById('un').focus();
}
</script>
<body>
<input type="text" name="unm" id="un"/>
<input type="button" name="Add" value="Add" onClick="add_text()" />
<hr/>
<div id="list" style="width:200px; height:100px; overflow:auto;">
</div>
</body>

Output:




No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...