0

I'm trying to do something very simple...just access a JavaScript function that exists in a separate file but I can't seem to get it to work.

<form id="form1" runat="server">
    <script type="text/javascript" src="styleScript.js"></script>   
    <div id="container" class="container">
  
 <button id="button1" onmouseover="mouseOver('button1')" style="margin-left:900px;width:200px;background-color:Transparent;height:100px;margin-top:120px;">About Me</button>

       </div>
     </div>
     </div>          
</form>

My styleScript.js class:

function mouseOver(var b)
{
    //do stuff
}

Is there anything I need to do to have my html access this javascript function that exists in a separate file??

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by RunTimeError
0

Forgot that you need script references in the header. Duh.

<head runat="server">
    <title>Welcome</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
      <script type="text/javascript" src="styleScript.js">
      </script>   
</head>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.