+ Reply to Thread
Results 1 to 2 of 2

Thread: Set max height of div using javascript

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    3

    Set max height of div using javascript

    I want to set max height of div on click of button using javascript.
    I tried to do it using following code but it's not working.

    Code:
    	var mHeight = "300px";
    	el.style.maxHeight=mHeight;

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    7
    Make sure that you set height of the div after you set maxheight.

    Code:
            var mHeight = "300px";
      	el.style.maxHeight=mHeight;
            el.style.Height="200px";

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts