Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
$('#ResizePageUp').click(function(){
    var size = $('#TextArea1').css('height');
    alert(size);
    size -= 50;
alert(size);


size in 2 alert is Equal!!!
Posted

Text area is designed to host integer number of lines. For this purpose, its height is defined in number of lines of text, which is controlled by the value of the attribute rows. With jQuery, use the method .attr():
JavaScript
$('#TextArea1').attr("rows", "15");

In this sample, the text area gets the height sufficient to show 15 rows of text.

—SA
 
Share this answer
 
JavaScript
$('#ResizePageUp').click(function(){
   $('#TextArea1').css("height","100px");
var size = $('#TextArea1').css("height");
alert(size);


alert show 100
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900