Html elements can be resized dynamically by using the style properties. In the below example the TextArea size is
increased dynamically on clicking the button.
<html>
<script language=javascript>
function resize()
{
document.form1.TextArea1.style.height=’600px’;
document.form1.TextArea1.style.width=’400px’;
}
</script>
<form name=form1>
<TextArea style='WIDTH: 200px; HEIGHT: 200px' name='TextArea1'></TextArea>
<input type='button' style='WIDTH: 100px; HEIGHT: 100px' name='button1'>
</form>
<input type=button value='ClickMe' onclick=javascript:resize()>
</html>
Share with