Hello,
I have come across a problem that seems common with firefox and the use of event. I have a simple javascript function which trys to determine the element that an event was acted upon:
[code]
function grabId(e)
{
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
alert(theId);
}
This is called on click of a input:
[code]
<input class=”registerInput” type=”text” name=”username” id=”username” onclick=”getId(event)” />
This seems to work correctly for every browser except firefox. A quick search online and all the fixes seem to include:
[code]
if (!e) var e = window.event;
But when I debug this function, neither e or event are defined, am i overlooking something really obvious?
Cheers