www.webdeveloper.com
Results 1 to 3 of 3

Thread: Javascript Error - Expected ';'

  1. #1
    Join Date
    Jan 2013
    Location
    Mumbai
    Posts
    2

    Post Javascript Error - Expected ';'

    Hi,

    I am new to Javascript, kindly help me with this problem.

    I am getting an error Expected ';' on line 5 and Object Expected at Line 17.

    The code is as follows:

    <HTML>
    <HEAD>
    <TITLE>OnFocus Event</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    Function whitebg()
    {
    document.bgColor="#FFFFFF";
    }
    function redbg()
    {
    document.bgColor="#FF0000";
    }
    </SCRIPT>
    </HEAD>

    <BODY>
    <p>Focus the button to Set background color of the form</p>
    <input type="button" name ="bred" onFocus="redbg()" value="Red">
    <input type="button" name ="bwhite" onFocus="whitebg()" value="White"><br>
    </BODY>
    </HTML>

    Thanks in Advance.
    Mridul

  2. #2
    Join Date
    Nov 2010
    Posts
    1,083
    looks to me like this is probably the problem:
    Code:
    Function whitebg()
    remember that javascript is case-sensitive...

  3. #3
    Join Date
    Jan 2013
    Location
    Mumbai
    Posts
    2

    resolved

    Thank you very much dear ... it worked. It should be function whitebg() and not Function.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles