Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dynamically assigning eventhandlers

lordislordis Member Posts: 2
I am trying to dynamically (with JavaScript) assign an eventhandler (onmouserover) to a dynamically created TD. The eventhandler gets assigned but when I hover nothing happens.
I have tried:

object.onmouseover = "eventhandler();";

object.setAttribute("onmouseover", "eventhandler();");

and a couple of other variants.
Could someone please help me with this problem?

Comments

  • NCS_OneNCS_One Member Posts: 170
    : I am trying to dynamically (with JavaScript) assign an eventhandler (onmouserover) to a dynamically created TD. The eventhandler gets assigned but when I hover nothing happens.
    : I have tried:
    :
    : object.onmouseover = "eventhandler();";
    :
    : object.setAttribute("onmouseover", "eventhandler();");
    :
    : and a couple of other variants.
    : Could someone please help me with this problem?
    :

    Hi

    Try calling it like this :

    object.onmouseover = eventhandler;

    Hope it helps.
  • CyGuyCyGuy Member Posts: 312
    : : I am trying to dynamically (with JavaScript) assign an eventhandler (onmouserover) to a dynamically created TD. The eventhandler gets assigned but when I hover nothing happens.
    : : I have tried:
    : :
    : : object.onmouseover = "eventhandler();";
    : :
    : : object.setAttribute("onmouseover", "eventhandler();");
    : :
    : : and a couple of other variants.
    : : Could someone please help me with this problem?
    : :
    :
    : Hi
    :
    : Try calling it like this :
    :
    : object.onmouseover = eventhandler;
    :
    : Hope it helps.
    :
    [green]to help find errors in Jscript coding
    try this:
    in internet explorer menu bar
    -click Tools
    -click internet Options
    -click advanced tab
    go down under Browsing
    and check the box that reads
    "Display a notification about every script error"

    now when you execute the HTML, any script errors will be reported.

    hope it helps[/green]


    [green]WHAT you;see_is_what=you.get;[/green]
    -Russ aka DangeRuss

Sign In or Register to comment.