#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Set height of article and aside areas using javascript


    I'd like to set the height of the <aside> and <article> areas of the page using javascript.

    any ideas?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    50
    Rep Power
    35
    Have you tried:
    Code:
    <article id="article1">Article contents</article>
    Code:
    article1.style.height = "400px";
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4304
    Welcome to DevShed Forums, loofemmaps.

    Would you mind explaining what you're trying to achieve? Do you want equal height columns or something?

    Originally Posted by Edge360
    Code:
    article1.style.height = "400px";
    Element IDs should not be treated as global variables. (Regardless of whether some browsers allow it or not.) You mean this:
    Code:
    document.getElementById('article1').style.height = "400px";
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo