Javascript Problem - Changing Event
I'm having problems changing the event of some elements. This following code works perfectly fine in Firefox:
HTML Code:
workin.attributes["onmouseover"].value = b2use+"(this.id)"
workin.attributes["onclick"].value = b2use+"2(this.id)"
But it doesn't work in IE, can someone help me with changing the event for IE?
Thank you.
PS. Anyone who is going to say use workin.onclick, don't bother. It doesn't work with functions that require parameters.
Re: Javascript Problem - Changing Event
I thought about it for a while and maybe you could make it call a function with no paramater using workin.onclick and that function that is called will then call another function WITH parameter?
An example:
HTML Code:
<script type="text/javascript">
<!--
document.getElementById('whatever').onclick = "var param='whatever';newfunction();";
function newfunction()
{
return therealfunctionwithaparam(param);
}
function therealfunctionwithaparam(param)
{
dowhateverhere();
return param;
}
//-->
</script>
Re: Javascript Problem - Changing Event
Wow, that makes sense. Thanks Rossco, I'll edit/repost once I've tried.
Nope, didn't work. :(