Take a look at the Mozilla Developer Center docs for events . In Internet Explorer, a global event object is created when an event is triggered. In standards-compliant browsers, the event object is passed as the first argument to the function assigned to the dismissal event. If your event is defined in HTML, the event object is created under the name of the variable event and can be passed to the functions that you call.
Also note that the event.srcElement property is only IE, and most other browsers use event.target instead.
Given this, your function should look like this:
<script> var previousColor; function Changecolor(evt) { var srcEl = evt.srcElement || evt.target; previousColor = srcEl.style.backgroundColor; srcEl.style.backgroundColor = "Blue"; srcEl.style.cursor = "pointer"; } function RestoreColor(evt) { var srcEl = evt.srcElement || evt.target; srcEl.style.backgroundColor = previousColor; } </script> <asp:Button ID="btnSearch" runat="server" BackColor="#800000" Font-Bold="True" Font-Names="Arial" onmouseover="Changecolor(event);" onmouseout="RestoreColor(event);" ForeColor="White" Height="28px" OnClick="btnSearch_Click2" Text="Search Jobz" Width="117px" />
source share