SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    bgcolor first program

    Hi,

    <html>
    <body bgcolor=”WHITE”>
    <p>Paragraph 1</p>
    <script type=”text/javascript”>
    document.bgColor = “RED”;
    </script>
    </body>
    </html>

    I am new to javascript and trying to run the first program in IE. It just prints the blank screen . please help

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    <html>
    <body style="background-color:white">
    <p>Paragraph 1</p>
    <script type=”text/javascript”>
    document.getElementsByTagName('body')[0].style.backgroundColor = 'red';
    </script>
    </body>
    </html>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •