Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    what is wrong with this...
    Code:
    document.getElementById('sitebutton').style.border-bottom = '0px';
    thanks
    JR

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Try borderBottom.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Yeah, border-bottom is a css property, where as JavaScript's DOM doesn't use hyphenation, instead it capitalizes the first letter of the second word. i.e. borderBottom, or backgroundColor, etc. Many of the properties are named the same, just the hyphenation is left out.
    - Brian

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    thanks, i will try it later
    JR

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Originally posted by skrlin
    Yeah, border-bottom is a css property, where as JavaScript's DOM doesn't use hyphenation, instead it capitalizes the first letter of the second word. i.e. borderBottom, or backgroundColor, etc. Many of the properties are named the same, just the hyphenation is left out.
    That's also a general naming convention in Java (I know that's not Javascript!) itself: lowercase first word, capitalize all other words' first letters.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    JavaScript is based on the syntax and "ease of use" of Java and that's why the naming convention holds for JS as well.

    I'm sure you knew that already... :-[
    - Brian

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Actually, camelCase (as it's called among us geeks) is commonly used in most programming languages for denoting instances (objects), properties (variables), and methods (functions). It's even being adopted by Microsoft for all it's .NET conventions. Amazing!

    Some other conventions that are becoming more popular are ProperCase, which is used for Class definitions, UPPER_CASE_UNDERSCORE, which is commonly used for constant definitions, and lower_case_underscore, which is used for database naming.

  9. #8
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    I knew what it was, just didn't know the term for it. I'll remember it now. 8-)
    - Brian


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:47 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com