Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    style.height issue...

    Hi all, i have the following function...

    Code:
    function ChangeTextboxSize(size) {
    
      var objBox = document.getElementById("txtComment");
      var curHeight = objBox.style.height;
      alert(curHeight)
      
    }
    and it should return a height of 90px; as defined in my css, yet it returns an empty alert box...can someone enlighten me as to why??

    Thanks, Justin

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Its doing exactly what it should. It would only return a value IF you used style="..." inside of that div. To get the css styles from the stylesheet you need to use the methods found here http://www.javascriptkit.com/dhtmltu...lcascade.shtml
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts
    awesome, thanks so much for the help!!
    Last edited by jussa; 10-14-2006 at 01:45 AM.


  •  

    Posting Permissions

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