Live Chat Icon For mobile
Live Chat Icon

How can you resize the html elements dynamically?

Platform: ASP.NET| Category: Client Side Scripting

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

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.